Module sc_network::multiaddr::multihash[][src]

Multihash

Implementation of multihash in Rust.

A Multihash is a structure that contains a hashing algorithm, plus some hashed data. A MultihashRef is the same as a Multihash, except that it doesn’t own its data.

Structs

Blake2b256

The Blake2b-256 hasher.

Blake2b512

The Blake2b-512 hasher.

Blake2s128

The Blake2s-128 hasher.

Blake2s256

The Blake2s-256 hasher.

DecodeOwnedError

Error that can happen when decoding some bytes.

Identity

The Identity hasher.

Keccak224

The Keccak-224 hasher.

Keccak256

The Keccak-256 hasher.

Keccak384

The Keccak-384 hasher.

Keccak512

The Keccak-512 hasher.

MultihashGeneric

Representation of a valid multihash. This enforces validity on construction, so it can be assumed this is always a valid multihash.

MultihashRefGeneric

Represents a valid multihash.

Sha1

The SHA-1 hasher.

Sha2_256

The SHA2-256 hasher.

Sha2_512

The SHA2-512 hasher.

Sha3_224

The SHA3-224 hasher.

Sha3_256

The SHA3-256 hasher.

Sha3_384

The SHA3-384 hasher.

Sha3_512

The SHA3-512 hasher.

Enums

Code

The code of Multihash.

DecodeError

Error that can happen when decoding some bytes.

EncodeError

Error that can happen when encoding some bytes into a multihash.

Traits

MultihashDigest

The MultihashDigest trait specifies an interface common for all multihash functions.

Multihasher

The Multihasher trait specifies an interface common for all multihash functions that does not require allocating a Box<dyn MultihashDigest<T>>.

Functions

wrap

Wraps a hash digest in Multihash with the given Mutlihash code.

Type Definitions

BoxedMultihashDigest

This type makes it easier to interact with hashers

Multihash

This type is using the default Multihash code table

MultihashRef

This type is using the default Multihash code table