MCPcopy Index your code
hub / github.com/anomalyco/opencode / generateRandomString

Function generateRandomString

packages/opencode/src/plugin/snowflake-cortex.ts:46–51  ·  view source on GitHub ↗
(length: number)

Source from the content-addressed store, hash-verified

44}
45
46function generateRandomString(length: number) {
47 const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~"
48 return Array.from(crypto.getRandomValues(new Uint8Array(length)))
49 .map((b) => chars[b % chars.length])
50 .join("")
51}
52
53function base64UrlEncode(buffer: ArrayBuffer) {
54 const binary = String.fromCharCode(...new Uint8Array(buffer))

Callers 2

generatePKCEFunction · 0.70
authorizeFunction · 0.70

Calls 1

fromMethod · 0.45

Tested by

no test coverage detected