31 lines
1006 B
TypeScript
Raw Normal View History

/**
* Class that encodes binary blobs into strings.
* Note that the encode/decode methods may change underlying encoding scheme.
*/
export default class Encoder {
/**
* Encodes given bytes into a Base64URL string.
*/
static encode(content: Uint8Array): string;
/**
* Decodes the given Base64URL string into bytes.
*/
static decodeAsBytes(encodedContent: string, inputContextForErrorLogging: string): Uint8Array;
/**
* Decodes the given Base64URL string into the original string.
*/
static decodeAsString(encodedContent: string, inputContextForErrorLogging: string): string;
/**
* Tests if the given string is a Base64URL string.
*/
static isBase64UrlString(input: string): boolean;
/**
* Converts input string to bytes.
*/
static stringToBytes(input: string): Uint8Array;
/**
* Converts bytes to string.
*/
static bytesToString(input: Uint8Array): string;
}
//# sourceMappingURL=Encoder.d.ts.map