Debian Codegraph @

node/@bufbuild/protobuf/dist/commonjs/wire/base64-encoding.d.ts

raw
1 /**
2 * Decodes a base64 string to a byte array.
3 *
4 * - ignores white-space, including line breaks and tabs
5 * - allows inner padding (can decode concatenated base64 strings)
6 * - does not require padding
7 * - understands base64url encoding:
8 * "-" instead of "+",
9 * "_" instead of "/",
10 * no padding
11 */
12 export declare function base64Decode(base64Str: string): Uint8Array<ArrayBuffer>;
13 type Base64Encoding = "std" | "std_raw" | "url";
14 /**
15 * Encode a byte array to a base64 string.
16 *
17 * By default, this function uses the standard base64 encoding with padding.
18 *
19 * To encode without padding, use encoding = "std_raw".
20 *
21 * To encode with the URL encoding, use encoding = "url", which replaces the
22 * characters +/ by their URL-safe counterparts -_, and omits padding.
23 */
24 export declare function base64Encode(bytes: Uint8Array, encoding?: Base64Encoding): string;
25 export {};