For encoding to/from base64urls implementing RFC 4648 base64url standard
89
Create a small module that turns base64url-encoded tokens into standard base64 strings with required = padding so legacy services that expect padded base64 accept the values.
"SGVsbG8td29ybGQ" returns "SGVsbG8td29ybGQ=" with padding restored @test"_w" returns "/w==" while preserving the original bytes @test["-w", " c3VtX3VzZXI "] returns ["+w==", "c3VtX3VzZXI="], trimming surrounding whitespace but keeping order @test"bad*token" (contains characters outside the base64url alphabet) results in an error that identifies the invalid token @test@generates
export function normalizeToken(base64urlToken: string): string;
export function normalizeCollection(tokens: Array<string>): string[];Provides base64url to base64 conversion utilities.
Install with Tessl CLI
npx tessl i tessl/npm-base64url