MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / generateToken

Function generateToken

apps/web/utilities/token.ts:3–8  ·  view source on GitHub ↗
(length: number = 16)

Source from the content-addressed store, hash-verified

1import { randomBytes } from 'crypto';
2
3export function generateToken(length: number = 16): string {
4 return (
5 randomBytes(length).toString('hex') +
6 Math.random().toString(length).substr(2)
7 );
8}

Callers 2

createFunction · 0.90
token.test.jsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected