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

Function generateRandomString

packages/utils/src/random.ts:38–43  ·  view source on GitHub ↗
(length = 16)

Source from the content-addressed store, hash-verified

36 * @returns Random string composed of A-Z, a-z, 0-9
37 */
38export function generateRandomString(length = 16): string {
39 const bytes = generateRandomBytes(length)
40 return Array.from(bytes)
41 .map((b) => CHARS[b % CHARS.length])
42 .join('')
43}
44
45/**
46 * Returns a cryptographically secure random float in [0, 1).

Callers 15

createUserFunction · 0.90
createWorkspaceFunction · 0.90
createWorkflowFunction · 0.90
generateEdgeIdFunction · 0.90
createDAGNodeFunction · 0.90
createExecutionContextFunction · 0.90
generateBlockIdFunction · 0.90
createMockSocketFunction · 0.90
addVariableMethod · 0.90
generateBoundaryFunction · 0.90

Calls 2

generateRandomBytesFunction · 0.85
joinMethod · 0.80

Tested by

no test coverage detected