MCPcopy Create free account
hub / github.com/arctic-cli/interface / randomBase62

Function randomBase62

packages/util/src/identifier.ts:18–26  ·  view source on GitHub ↗
(length: number)

Source from the content-addressed store, hash-verified

16 }
17
18 function randomBase62(length: number): string {
19 const chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
20 let result = ""
21 const bytes = randomBytes(length)
22 for (let i = 0; i < length; i++) {
23 result += chars[bytes[i] % 62]
24 }
25 return result
26 }
27
28 export function create(descending: boolean, timestamp?: number): string {
29 const currentTimestamp = timestamp ?? Date.now()

Callers 1

createFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected