paseto-ts
Version:
PASETO v4 (encrypt, decrypt, sign & verify) in TypeScript
24 lines (23 loc) • 1.08 kB
TypeScript
/**
* Convert UTF-8 data in a Uint8Array to a string
* @param {Uint8Array} buffer Uint8Array to convert
* @returns {string} UTF-8 string representation of the Uint8Array
* {TypeError} if the input is not a Uint8Array
* @see https://developer.mozilla.org/en-US/docs/Glossary/Base64
* @see https://developer.mozilla.org/en-US/docs/Web/API/btoa
*/
export declare function base64UrlEncode(buffer: Uint8Array): string;
/**
* Convert a base64url encoded string to a Uint8Array
* @param {string} str base64url encoded string to convert
* @returns {Uint8Array} Uint8Array representation of the base64url encoded string
* @see https://developer.mozilla.org/en-US/docs/Glossary/Base64
* @see https://developer.mozilla.org/en-US/docs/Web/API/atob
*/
export declare function base64UrlDecode(str: string): Uint8Array;
/**
* Convert a base64url encoded string to a string
* @param {string} str base64url encoded string to convert
* @returns {string} string representation of the base64url encoded string
*/
export declare function base64UrlDecodeString(str: string): string;