@toolkit-p2p/mesh-cache
Version:
Content-addressed mesh cache for toolkit-p2p
25 lines • 670 B
TypeScript
/**
* Content Identifier (CID) generation using SHA-256
*/
import type { CID } from './types.js';
/**
* Generate CID from data using SHA-256
*/
export declare function generateCID(data: Uint8Array): CID;
/**
* Encode bytes as base58 string
*/
export declare function base58Encode(bytes: Uint8Array): string;
/**
* Decode base58 string to bytes
*/
export declare function base58Decode(str: string): Uint8Array;
/**
* Verify that a string is a valid CID
*/
export declare function isValidCID(cid: string): boolean;
/**
* Verify that data matches a CID
*/
export declare function verifyCID(data: Uint8Array, cid: CID): boolean;
//# sourceMappingURL=cid.d.ts.map