server/utils/math.ts
2024-06-12 19:38:26 -10:00

5 lines
174 B
TypeScript

export const randomString = (length: number, encoding?: BufferEncoding) =>
Buffer.from(crypto.getRandomValues(new Uint8Array(length))).toString(
encoding,
);