mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-09 21:17:15 +03:00
5 lines
243 B
TypeScript
5 lines
243 B
TypeScript
import crypto from "crypto";
|
|
|
|
export const genRandom = (bytes=8) => crypto.pseudoRandomBytes(bytes).toString("hex");
|
|
|
|
export const genRandomValue = (prefix: string, identifier: string, bytes=8) => `${prefix}-${identifier}-${genRandom(bytes)}`; |