multiformats - v13.3.6
    Preparing search index...

    Interface SyncMultihashHasher<Code>

    Sync variant of MultihashHasher that refines return type of the digest to MultihashDigest. It is subtype of MultihashHasher so implementations of this interface can be passed anywhere MultihashHasher is expected, allowing consumer to either await or check the return type to decide whether to await or proceed with return value.

    SyncMultihashHasher is useful in certain APIs where async hashing would be impractical e.g. implementation of Hash Array Mapped Trie (HAMT).

    interface SyncMultihashHasher<Code extends number = number> {
        code: Code;
        name: string;
        digest(input: Uint8Array): MultihashDigest<Code>;
    }

    Type Parameters

    • Code extends number = number

    Hierarchy (View Summary)

    Index

    Properties

    Methods

    Properties

    code: Code

    Code of the multihash

    name: string

    Name of the multihash

    Methods