10 lines
238 B
TypeScript
10 lines
238 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(
|
||
|
|
""
|
||
|
|
);
|
||
|
|
};
|