phase 2 and 3
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import { randomBytes } from "node:crypto";
|
||||
|
||||
/**
|
||||
* Operation QR tokens are opaque, URL-safe, high-entropy identifiers
|
||||
* printed on traveler cards. 24 bytes = 192 bits of entropy, encoded
|
||||
* as base64url -> 32 characters.
|
||||
*/
|
||||
export function generateQrToken(): string {
|
||||
return randomBytes(24)
|
||||
.toString("base64")
|
||||
.replace(/\+/g, "-")
|
||||
.replace(/\//g, "_")
|
||||
.replace(/=+$/, "");
|
||||
}
|
||||
Reference in New Issue
Block a user