@ipld/car
Version:
Content Addressable aRchive format reader and writer
43 lines • 1.12 kB
TypeScript
/**
* Decodes varint and seeks the buffer
*
* ```js
* // needs bytes to be read first
* const bytes = reader.upTo(8) // maybe async
* ```
*
* @param {Uint8Array} bytes
* @param {import('./coding').Seekable} seeker
* @returns {number}
*/
export function decodeVarint(bytes: Uint8Array, seeker: import('./coding').Seekable): number;
/**
* Decode v2 header
*
* ```js
* // needs bytes to be read first
* const bytes = reader.exactly(V2_HEADER_LENGTH, true) // maybe async
* ```
*
* @param {Uint8Array} bytes
* @returns {import('./coding').CarV2FixedHeader}
*/
export function decodeV2Header(bytes: Uint8Array): import('./coding').CarV2FixedHeader;
/**
* Checks the length of the multihash to be read afterwards
*
* ```js
* // needs bytes to be read first
* const bytes = reader.upTo(8) // maybe async
* ```
*
* @param {Uint8Array} bytes
*/
export function getMultihashLength(bytes: Uint8Array): number;
export namespace CIDV0_BYTES {
let SHA2_256: number;
let LENGTH: number;
let DAG_PB: number;
}
export const V2_HEADER_LENGTH: number;
//# sourceMappingURL=decoder-common.d.ts.map