Documentation ¶
Overview ¶
Package maphasher provides hashing for maps.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Default = New(crypto.SHA256)
Default is a SHA256 based MapHasher for maps.
Functions ¶
Types ¶
type MapHasher ¶
MapHasher implements a sparse merkle tree hashing algorithm. For testing only. It matches the test vectors generated by other sparse map implementations, but it does not offer the full N bit security of the underlying hash function.
func (*MapHasher) HashChildren ¶
HashChildren returns the internal Merkle tree node hash of the the two child nodes l and r. The hashed structure is NodeHashPrefix||l||r.
func (*MapHasher) HashEmpty ¶
HashEmpty returns the hash of an empty subtree of the given height, e.g. the height of 0 indicates an empty leaf. For this hasher, the result depends only on height. The treeID and index, i.e. the precise position of this subtree, are ignored.