iso-base
Version:
Isomorphic Utils
22 lines • 791 B
TypeScript
export namespace unsigned {
/**
* Decode a Uint8Array into a number.
*
* @param {Uint8Array} buf - Uint8Array containing the representation in LEB128
* @param {number} offset - Offset to read from
* @returns {[bigint, number]} - The decoded number and the number of bytes read
*/
function decode(buf: Uint8Array, offset?: number): [bigint, number];
/**
* Create a LEB128 Uint8Array from a number
*
* @param {number | string | bigint} num - Number to convert from
*/
function encode(num: number | string | bigint): Uint8Array<ArrayBuffer>;
/**
* @param {Uint8Array} buf
* @param {number} offset
*/
function encodingLength(buf: Uint8Array, offset?: number): number;
}
//# sourceMappingURL=leb128.d.ts.map