MCPcopy
hub / github.com/npmx-dev/npmx.dev / generateRandomHexString

Function generateRandomHexString

server/api/auth/atproto.get.ts:170–174  ·  view source on GitHub ↗
(byteLength: number = 16)

Source from the content-addressed store, hash-verified

168}
169
170function generateRandomHexString(byteLength: number = 16): string {
171 return Array.from(crypto.getRandomValues(new Uint8Array(byteLength)), byte =>
172 byte.toString(16).padStart(2, '0'),
173 ).join('')
174}
175
176/**
177 * This function ensures that an oauth state was indeed encoded for the browser

Callers 1

encodeOAuthStateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected