Expand description
Defines AiHash and its various HashTypes
Re-exports§
pub use encode::ai_hash_decode;pub use encode::ai_hash_decode_unchecked;pub use encode::ai_hash_encode;pub use hash_type::HashType;pub use hash_type::PrimitiveHashType;pub use hash_b64::*;
Modules§
- encode
- Include nice string encoding methods and From impls
- error
- AiHash Error Type.
- fixt
- hash_
b64 - Implements base-64 serialization for AiHashes
- hash_
type - Defines the prefixes for the various HashTypes, as well as the traits which unify them
Macros§
- assert_
length - Helper for ensuring the the proper number of bytes is used in various situations
- impl_
hashable_ content - A default HashableContent implementation, suitable for content which
is already TryInto
, and uses a PrimitiveHashType
Structs§
- AiHash
- A AiHash contains a vector of 36 bytes representing a 32-byte blake2b hash plus 4 bytes representing a SGD location. It also contains a zero-sized type which specifies what it is a hash of.
- AiHashed
- 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.
- Entry
Hashes - A newtype for a collection of EntryHashes, needed for some wasm return types.
Enums§
- Hashable
Content Bytes - HashableContent can be expressed as “content”, or “prehashed”, which affects how a AiHashed type will be constructed from it.
Constants§
- AI_
HASH_ CORE_ LEN - Length of the core bytes (32)
- AI_
HASH_ FULL_ LEN - Length of the full AiHash bytes (39 = 3 + 32 + 4)
- AI_
HASH_ LOC_ LEN - Length of the location bytes (4)
- AI_
HASH_ PREFIX_ LEN - Length of the prefix bytes (3)
- AI_
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 AiHashOf.
- Hashable
Content - Any implementor of HashableContent may be used in a AiHashed to pair data with its AiHash representation. It also has an associated HashType.
Type Aliases§
- Agent
PubKey - An Agent public signing key. Not really a hash, more of an “identity hash”.
- AiHash
Of - A convenience type, for specifying a hash by HashableContent rather than by its HashType
- AnySgd
Hash - The hash of anything referrable in the SGD. This is a composite of either an EntryHash or a HeaderHash
- Entry
Hash - The hash of an Entry.
- Header
Hash - The hash of a Header
- NetId
Hash - The hash of a network ID
- SafHash
- The hash of a SafDef
- SgdOp
Hash - The hash of a SgdOp’s “unique form” representation
- Wasm
Hash - The hash of some wasm bytecode