lockCategoriesHTTP

- highLoad
- compact getUserID
- add genRandomValue method
This commit is contained in:
Michael C
2023-09-27 23:19:25 -04:00
parent 5e3ec895d8
commit 7364499f11
6 changed files with 87 additions and 229 deletions

View File

@@ -1,3 +1,5 @@
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)}`;