MCPcopy Create free account
hub / github.com/codesandbox/sandpack / generateRandomId

Function generateRandomId

sandpack-react/src/utils/stringUtils.ts:114–117  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

112// Minimal cuid-like id
113let lastCount = 0;
114export const generateRandomId = (): string => {
115 const random = +(Date.now().toString(10).substr(0, 4) + lastCount++);
116 return random.toString(16);
117};

Callers 5

useSandpackIdFunction · 0.90
useAsyncSandpackIdFunction · 0.90
addListenerFunction · 0.90
useSandpackClientFunction · 0.90
useSandpackShellStdoutFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected