UNPKG

@credo-ts/core

Version:

<p align="center"> <br /> <img alt="Credo Logo" src="https://github.com/openwallet-foundation/credo-ts/blob/c7886cb8377ceb8ee4efe8d264211e561a75072d/images/credo-logo.png" height="250px" /> </p> <h1 align="center"><b>Credo - Core</b></h1

39 lines (38 loc) • 966 B
import { HashName } from "../crypto/hashes/Hasher.mjs"; //#region src/utils/MultiHashEncoder.d.ts declare class MultiHashEncoder { /** * * Encodes a buffer into a hash * * @param buffer the buffer that has to be encoded * @param hashName the hashing algorithm, 'sha-256' * * @returns a multihash */ static encode(data: Uint8Array, hashName: HashName): Uint8Array; /** * * Decodes the multihash * * @param data the multihash that has to be decoded * * @returns object with the data and the hashing algorithm */ static decode(data: Uint8Array): { data: Uint8Array; hashName: string; }; /** * * Validates if it is a valid mulithash * * @param data the multihash that needs to be validated * * @returns a boolean whether the multihash is valid */ static isValid(data: Uint8Array): boolean; } //#endregion export { MultiHashEncoder }; //# sourceMappingURL=MultiHashEncoder.d.mts.map