Documentation ¶
Overview ¶
merkle tree manipulation routines
Index ¶
Constants ¶
const DigestLength = 32
number of bytes in the digest
Variables ¶
This section is empty.
Functions ¶
func DigestFromBytes ¶
convert and validate Little Endian binary byte slice to a digest the input bytes are Little Endian
Types ¶
type Digest ¶
type Digest [DigestLength]byte
type for a digest
* stored as Little Endian byte array * represented as Big Endian hex value for printf and scanf * represented as Little Endian hex text for JSON encoding * to convert to bytes just use d[:]
func FullMerkleTree ¶
compute minimum merkle root from a set of transaction ids
structure is:
- N * transaction digests
- level 1..m digests
- merkle root digest
func (Digest) GoString ¶
convert a binary digest to Big Endian hex string for use by the fmt package (for %#v)
func (Digest) MarshalText ¶
convert digest to Little Endian hex text
func (*Digest) Scan ¶
convert a Big Endian hex representation to a digest for use by the format package scan routines
func (Digest) String ¶
convert a binary digest to Big Endian hex string for use by the fmt package (for %s)
func (*Digest) UnmarshalText ¶
convert Little Endian hex text into a digest