MCPcopy
hub / github.com/simstudioai/sim / generateRandomBytes

Function generateRandomBytes

packages/utils/src/random.ts:16–18  ·  view source on GitHub ↗
(length: number)

Source from the content-addressed store, hash-verified

14 * @returns Uint8Array of random bytes
15 */
16export function generateRandomBytes(length: number): Uint8Array {
17 return crypto.getRandomValues(new Uint8Array(length))
18}
19
20/**
21 * Generates a cryptographically secure random hex string.

Callers 2

generateRandomHexFunction · 0.85
generateRandomStringFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected