package
0.1.0-alpha-26
Repository: https://github.com/metacurrency/holochain.git
Documentation: pkg.go.dev
# Functions
HashFromBytes cast a byte slice to Hash type, and validate the id to make sure it is a multihash.
HashFromPeerID copy the bytes from a peer ID to Hash.
Less returns whether the first key is smaller than the second.
Distance returns the distance metric between two hashes.
NewHash builds a Hash from a b58 string encoded hash.
NullHash builds a null valued hash.
PeerIDFromHash copy the bytes from a hash to a peer ID.
SortByDistance takes a center Hash, and a list of Hashes toSort.
Sum builds a digest according to the specs in the Holochain.
UnmarshalHash reads a hash from a binary stream.
XOR takes two byte slices, XORs them together, returns the resulting slice.
ZeroPrefixLen returns the number of consecutive zeroes in a byte slice.
# Structs
hashDistance helper struct for sorting by distance which pre-caches the distance to center so as not to recalculate it on every sort comparison.
HashSpec holds the info that tells what kind of hash this is.