Crate tiny_multihash

Source
Expand description

Multihash implementation.

§Feature Flags

Multihash has lots of feature flags, by default, all features (except for test) are enabled.

Some of them are about specific hash functions, these are:

  • blake2b: Enable Blake2b hashers
  • blake2s: Enable Blake2s hashers
  • sha1: Enable SHA-1 hashers
  • sha2: Enable SHA-2 hashers
  • sha3: Enable SHA-3 hashers
  • strobe: Enable Strobe hashers

In order to enable all hashers, you can set the all feature flag.

The library has support for no_std, if you disable the std feature flag.

The multihash-impl feature flag enables a default Multihash implementation that contains all bundled hashers (which may be disabled via the feature flags mentioned above). If only want a specific subset of hash algorithms or add one which isn’t supporte by default, you will likely disable that feature and enable derive in order to be able to use the Multihash derive.

The test feature flag enables property based testing features.

Re-exports§

pub use generic_array::typenum;
pub use tiny_multihash_derive as derive;

Structs§

Blake2bDigest
Multihash digest.
Blake2bHasher
Multihash hasher.
Blake2sDigest
Multihash digest.
Blake2sHasher
Multihash hasher.
Blake3Digest
Multihash digest.
Blake3Hasher
Multihash hasher.
IdentityDigest
Multihash digest.
IdentityHasher
Identity hasher with a maximum size.
Keccak224
Multihash hasher.
Keccak256
Multihash hasher.
Keccak384
Multihash hasher.
Keccak512
Multihash hasher.
KeccakDigest
Multihash digest.
Multihash
A Multihash instance that only supports the basic functionality and no hashing.
Sha1
Multihash hasher.
Sha1Digest
Multihash digest.
Sha2Digest
Multihash digest.
Sha2_256
Multihash hasher.
Sha2_512
Multihash hasher.
Sha3Digest
Multihash digest.
Sha3_224
Multihash hasher.
Sha3_256
Multihash hasher.
Sha3_384
Multihash hasher.
Sha3_512
Multihash hasher.
StrobeDigest
Multihash digest.
StrobeHasher
Strobe hasher.
UnknownDigest
Multihash digest.
WriteHasher
New type wrapper for a hasher that implements the std::io::Write trait.

Enums§

Code
Default (cryptographically secure) Multihash implementation.
Error
Multihash error.

Traits§

Digest
Stack allocated digest trait.
Hasher
Trait implemented by a hash function implementation.
MultihashCode
Trait that implements hashing.
Size
Size marker trait.
StatefulHasher
Trait implemented by a hash function implementation.

Type Aliases§

Blake2b256
256 bit blake2b hasher.
Blake2b512
512 bit blake2b hasher.
Blake2s128
256 bit blake2b hasher.
Blake2s256
512 bit blake2b hasher.
Blake3_256
blake3-256 hasher.
Identity256
32 byte Identity hasher (constrained to 32 bytes).
Result
Multihash result.
Strobe256
256 bit strobe hasher.
Strobe512
512 bit strobe hasher.
U16
U20
U28
U32
U48
U64
U128