fix: 8 groups of 8 chars, not 16 groups of 4
This commit is contained in:
@@ -4,8 +4,8 @@ import sql from "../db";
|
||||
|
||||
function generateKey(): string {
|
||||
const hex = randomBytes(32).toString("hex"); // 64 hex chars
|
||||
// Format as 8 groups of 4: XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX
|
||||
return (hex.match(/.{4}/g) as string[]).join("-").toUpperCase();
|
||||
// Format as 8 groups of 8: XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX-XXXXXXXX
|
||||
return (hex.match(/.{8}/g) as string[]).join("-").toUpperCase();
|
||||
}
|
||||
|
||||
function normalizeKey(raw: string): string {
|
||||
|
||||
Reference in New Issue
Block a user