Expand description

Defines HoloHash and its various HashTypes


pub use hash_type::HashType;


By default, disable string encoding and just display raw bytes

HoloHash Error Type.

Defines the prefixes for the various HashTypes, as well as the traits which unify them


Helper for ensuring the the proper number of bytes is used in various situations

A default HashableContent implementation, suitable for content which is already TryInto, and uses a PrimitiveHashType


A newtype for a collection of EntryHashes, needed for some wasm return types.

A HoloHash contains a vector of 36 bytes representing a 32-byte blake2b hash plus 4 bytes representing a DHT location. It also contains a zero-sized type which specifies what it is a hash of.

Represents some piece of content along with its hash representation, so that hashes need not be calculated multiple times. Provides an easy constructor which consumes the content.


The primitive hash types represented by this composite hash

The primitive hash types represented by this composite hash

HashableContent can be expressed as “content”, or “prehashed”, which affects how a HoloHashed type will be constructed from it.


Length of the core bytes (32)

Length of the full HoloHash bytes (39 = 3 + 32 + 4)

Length of the location bytes (4)

Length of the prefix bytes (3)

Length of the core bytes + the loc bytes (36 = 32 + 4), i.e. everything except the type prefix


Anything which has an owned HoloHashOf.

Any implementor of HashableContent may be used in a HoloHashed to pair data with its HoloHash representation. It also has an associated HashType.

A PrimitiveHashType is one with a multihash prefix. In contrast, a non-primitive hash type could be one of several primitive types, e.g. an AnyDhtHash can represent one of three primitive types.

Type Definitions

An Agent public signing key. Not really a hash, more of an “identity hash”.

The hash of anything referrable in the DHT. This is a composite of either an EntryHash or a HeaderHash

The hash of anything linkable.

The hash of a DhtOp’s “unique form” representation

The hash of a DnaDef

The hash of an Entry.

The hash of some external data that can’t or doesn’t exist on the DHT.

The hash of a Header

A convenience type, for specifying a hash by HashableContent rather than by its HashType

The hash of a network ID

The hash of some wasm bytecode