mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-04 22:11:36 +00:00
13 lines
350 B
TypeScript
13 lines
350 B
TypeScript
/**
|
|
* Gateway token generation helper.
|
|
*
|
|
* Tokens are opaque random hex strings used by setup when no explicit gateway
|
|
* token or secret reference exists.
|
|
*/
|
|
import crypto from "node:crypto";
|
|
|
|
/** Generates a new 192-bit gateway token encoded as hex. */
|
|
export function randomToken(): string {
|
|
return crypto.randomBytes(24).toString("hex");
|
|
}
|