Files
winninghunter/src/lib/auth/crypto.ts
T
2026-07-07 20:40:43 +03:00

10 lines
241 B
TypeScript

import crypto from "crypto";
export function randomToken(bytes = 32) {
return crypto.randomBytes(bytes).toString("base64url");
}
export function sha256(input: string) {
return crypto.createHash("sha256").update(input).digest("hex");
}