makeNonce
@forge/monorepo / backend/src / makeNonce
Function: makeNonce()
makeNonce(
randomHex):string
Defined in: backend/src/security/prompt-safety.ts:154
A nonce from an injected random source.
Injected because a test needs to pin it, and because the platform's own convention is that a module which
reaches for crypto directly is a module that cannot be tested deterministically. A caller wires
crypto.randomBytes or crypto.getRandomValues.
Parameters
randomHex
(bytes) => string
Returns
string