forked from hikmet4434/winninghunter
10 lines
241 B
TypeScript
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");
|
|
}
|