Crate holo_hash

Source
Expand description

Defines HoloHash and its various HashTypes

Re-exports§

pub use hash_type::HashType;
pub use hash_type::PrimitiveHashType;

Modules§

encode_raw
By default, disable string encoding and just display raw bytes
hash_type
Defines the prefixes for the various HashTypes, as well as the traits which unify them

Macros§

assert_length
Helper for ensuring the proper number of bytes is used in various situations
impl_hashable_content
A default HashableContent implementation, suitable for content which is already TryInto<SerializedBytes>, and uses a PrimitiveHashType

Structs§

CompositeHashConversionError
Error converting a composite hash into a subset composite hash, due to type mismatch
EntryHashes
A newtype for a collection of EntryHashes, needed for some wasm return types.
HashConversionError
Error converting a composite hash into a primitive one, due to type mismatch
HoloHash
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.
HoloHashed
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.

Enums§

AnyDhtHashPrimitive
The primitive hash types represented by this composite hash
AnyLinkableHashPrimitive
The primitive hash types represented by this composite hash
HashableContentBytes
HashableContent can be expressed as “content”, or “prehashed”, which affects how a HoloHashed type will be constructed from it.
HoloHashError
HoloHash Error Type.

Constants§

HOLO_HASH_CORE_LEN
Length of the core bytes (32)
HOLO_HASH_FULL_LEN
Length of the full HoloHash bytes (39 = 3 + 32 + 4)
HOLO_HASH_LOC_LEN
Length of the location bytes (4)
HOLO_HASH_PREFIX_LEN
Length of the prefix bytes (3)
HOLO_HASH_UNTYPED_LEN
Length of the core bytes + the loc bytes (36 = 32 + 4), i.e. everything except the type prefix

Traits§

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

Type Aliases§

ActionHash
The hash of an action
AgentPubKey
An Agent public signing key. Not really a hash, more of an “identity hash”.
AnyDhtHash
The hash of anything referrable in the DHT. This is a composite of either an EntryHash or a ActionHash
AnyLinkableHash
The hash of anything linkable.
DhtOpHash
The hash of a DhtOp’s “unique form” representation
DnaHash
The hash of a DnaDef
EntryHash
The hash of an Entry.
ExternalHash
The hash of some external data that can’t or doesn’t exist on the DHT.
HoloHashOf
A convenience type, for specifying a hash by HashableContent rather than by its HashType
HoloHashResult
HoloHash Result type
NetIdHash
The hash of a network ID
OpBasis
Alias for AnyLinkableHash. This hash forms the notion of the “basis hash” of an op.
WarrantHash
The hash of a Warrant
WasmHash
The hash of some wasm bytecode
ZomeCallSigningKey
A public key of a pair of signing keys for signing zome calls.