feat(lstv2 move): moved lstv2 into this app to keep them combined and easier to maintain

This commit is contained in:
2025-09-19 22:22:05 -05:00
parent caf2315191
commit e4477402ad
847 changed files with 165801 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
import crypto from "crypto";
export const generateOneTimeKey = async (length = 32) => {
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
let key = "";
const bytes = crypto.randomBytes(length);
for (let i = 0; i < length; i++) {
key += chars[bytes[i] % chars.length];
}
return key.match(/.{1,4}/g)!.join("-"); // group by 4 chars
};