/** * Unified encoding utilities for biometric authentication. * * Conversions are explicit: callers choose base64 vs base64url. There is intentionally * no "guess the encoding of a string" helper — guessing silently mis-decodes plain * strings as base64 (a string like "test" is valid base64), corrupting challenges and * credential IDs. Use the explicit functions below. */ /** * Convert ArrayBuffer to standard base64 string */ export declare function arrayBufferToBase64(buffer: ArrayBuffer): string; /** * Convert ArrayBuffer to base64url string (WebAuthn standard) * Base64url is URL-safe: uses - instead of +, _ instead of /, no padding */ export declare function arrayBufferToBase64URL(buffer: ArrayBuffer): string; /** * Convert standard base64 string to ArrayBuffer */ export declare function base64ToArrayBuffer(base64: string): ArrayBuffer; /** * Convert base64url string to ArrayBuffer */ export declare function base64URLToArrayBuffer(base64url: string): ArrayBuffer; /** * Convert Uint8Array to base64url string */ export declare function uint8ArrayToBase64URL(array: Uint8Array): string; /** * Convert base64url string to Uint8Array */ export declare function base64URLToUint8Array(base64url: string): Uint8Array; /** * Generate a cryptographically secure random session ID (base64url) */ export declare function generateSessionId(): string; /** * Generate a cryptographically secure random challenge */ export declare function generateChallenge(length?: number): ArrayBuffer; /** * Check if a string is valid base64url (URL-safe alphabet, no padding). Rejects empty. */ export declare function isBase64URL(str: string): boolean; /** * Check if a string is valid standard base64. Rejects empty. */ export declare function isBase64(str: string): boolean;