live · mainnetoc · docs
specs · api · guides
docs / documentation

@orangecheck/pledge-core


@orangecheck/pledge-core / generateNonce

Function: generateNonce()

function generateNonce(): string;

Defined in: pledge-core/src/canonical.ts:423

Generate a 32-char-hex random nonce (16 random bytes). Uses globalThis.crypto which is available in Node 20+ and every browser. Throws if the runtime lacks a crypto source; callers wanting deterministic test fixtures pass an explicit nonce instead.

Returns

string