Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
jajbshjahavahh
GitHub Repository: jajbshjahavahh/Gojo-Satoru
Path: blob/master/node_modules/@protobufjs/base64/index.d.ts
2591 views
1
/**
2
* Calculates the byte length of a base64 encoded string.
3
* @param {string} string Base64 encoded string
4
* @returns {number} Byte length
5
*/
6
export function length(string: string): number;
7
8
/**
9
* Encodes a buffer to a base64 encoded string.
10
* @param {Uint8Array} buffer Source buffer
11
* @param {number} start Source start
12
* @param {number} end Source end
13
* @returns {string} Base64 encoded string
14
*/
15
export function encode(buffer: Uint8Array, start: number, end: number): string;
16
17
/**
18
* Decodes a base64 encoded string to a buffer.
19
* @param {string} string Source string
20
* @param {Uint8Array} buffer Destination buffer
21
* @param {number} offset Destination offset
22
* @returns {number} Number of bytes written
23
* @throws {Error} If encoding is invalid
24
*/
25
export function decode(string: string, buffer: Uint8Array, offset: number): number;
26
27
/**
28
* Tests if the specified string appears to be base64 encoded.
29
* @param {string} string String to test
30
* @returns {boolean} `true` if it appears to be base64 encoded, otherwise false
31
*/
32
export function test(string: string): boolean;
33
34