package maphasher
import "github.com/google/trillian/merkle/maphasher"
Package maphasher provides hashing for maps.
Index ¶
Variables ¶
Default is a SHA256 based MapHasher for maps.
Functions ¶
func New ¶
New creates a new merkle.MapHasher using the passed in hash function.
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) BitLen ¶
BitLen returns the number of bits in the 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 branch at a given depth. A depth of 0 indicates the hash of an empty leaf. Empty branches within the tree are plain interior nodes e1 = H(e0, e0) etc.
func (*MapHasher) HashLeaf ¶
HashLeaf returns the Merkle tree leaf hash of the data passed in through leaf. The hashed structure is leafHashPrefix||leaf.
func (*MapHasher) String ¶
String returns a string representation for debugging.
Source Files ¶
- Version
- v1.2.0
- Published
- Jun 22, 2018
- Platform
- js/wasm
- Imports
- 5 packages
- Last checked
- 6 minutes ago –
Tools for package owners.