decord/alpha/source/modules/webauthn/WebAuthnUtils.tsx
github-actions 45f5884862 chore: update source for alpha 348.2
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/05xxx/module_5012.js (118.4 MB)
2026-09-23 06:49:31 +00:00

23 lines
855 B
TypeScript

// Module ID: 6926
// Function ID: 6927
// Name: WebAuthnUtils
// Dependencies: [2]
// Exports: encodeUserIdForWebAuthn
// Module 6926 (WebAuthnUtils)
import size from "module_2" /* 2 */;
const result = size.fileFinishedImporting("modules/webauthn/WebAuthnUtils.tsx");
export const encodeUserIdForWebAuthn = function encodeUserIdForWebAuthn(id) {
const uint8Array = new Uint8Array(16);
const dataView = new DataView(uint8Array.buffer);
dataView.setUint32(0, 821232635);
dataView.setUint16(4, 35878);
dataView.setUint16(6, 20307);
dataView.setBigUint64(8, BigInt(id));
const items = [...uint8Array];
const str = btoa(String.fromCharCode.apply(items));
const str2 = btoa(String.fromCharCode.apply(items)).replace(/\+/g, "-");
return btoa(String.fromCharCode.apply(items)).replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, "");
};