Documentation ¶
Index ¶
Constants ¶
const HashLen = 32
HashLen is the ledger default output hash length in bytes
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Hash ¶
Hash is the hash type used in all ledger
var DummyHash Hash
DummyHash is an arbitrary hash value, used in function errors. DummyHash represents a valid hash value.
func HashInterNode ¶
HashInterNode returns the hash value for intermediate nodes. hash1 and hash2 are fixed-length byte arrays which should be holding exactly 32 bytes each.
func HashLeaf ¶
HashLeaf returns the hash value for leaf nodes. Path is a fixed-length byte array which should be holding exactly 32 bytes. Note that we don't include the keys here as they are already included in the path.
func ToHash ¶
ToHash converts a byte slice to Hash (fixed-length byte array). It returns an error if the slice has an invalid length.