7 lines
230 B
TypeScript
7 lines
230 B
TypeScript
import crypto from "crypto";
|
|
|
|
export const generateToken = (): string => {
|
|
const array = new Uint8Array(32);
|
|
crypto.getRandomValues(array);
|
|
return Array.from(array, (byte) => byte.toString(36).padStart(2, "0")).join("");
|
|
};
|