For encoding to/from base64urls implementing RFC 4648 base64url standard
89
A small utility that turns text or binary payloads into URL-safe tokens using base64url encoding.
Buffer containing the bytes de ad be ef (hex), it returns the base64url string "3q2-7w". @test[0x00, 0xff, 0x10] and an encoding option set to "binary", it returns the base64url string "AP8Q". @test@generates
export interface TokenOptions {
encoding?: BufferEncoding;
}
/**
* Creates a URL-safe base64 token from text or binary input.
*/
export function createUrlToken(
input: string | Buffer,
options?: TokenOptions
): string;Provides base64url transformations for text and binary data.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-base64url