xtablo-source/api/src/token.ts

8 lines
230 B
TypeScript
Raw Normal View History

2025-07-03 19:42:49 +00:00
import crypto from "crypto";
export const generateToken = (): string => {
const array = new Uint8Array(32);
crypto.getRandomValues(array);
2025-10-10 06:21:56 +00:00
return Array.from(array, (byte) => byte.toString(36).padStart(2, "0")).join("");
2025-07-03 19:42:49 +00:00
};