UNPKG

@safeheron/crypto-utils

Version:
33 lines (32 loc) 1.22 kB
/** * Convert binary data to and from UrlBase64 encoding. * This is identical to Base64 encoding, except that the padding character is "." and the other * non-alphanumeric characters are "-" and "_" instead of "+" and "/". * The purpose of UrlBase64 encoding is to provide a compact encoding of binary data that is safe * for use as an URL parameter. Base64 encoding does not produce encoded values that are safe for * use in URLs, since "/" can be interpreted as a path delimiter; "+" is the encoded form of a space; * and "=" is used to separate a name from the corresponding value in an URL parameter. */ import { CryptoJSBytes } from "./exportTypes"; export declare class UrlBase64 { /** * UrlBase64 ===> Bytes: * @param urlBase64 */ static toBytes(urlBase64: string): Uint8Array; /** * Bytes(Uint8Array) ===> UrlBase64: * @param bytes */ static fromBytes(bytes: Uint8Array): string; /** * UrlBase64 ===> CryptoJSBytes: * @param urlBase64 */ static toCryptoJSBytes(urlBase64: string): CryptoJSBytes; /** * CryptoJSBytes ===> UrlBase64: * @param bytes */ static fromCryptoJSBytes(bytes: CryptoJSBytes): string; }