Documentation ¶
Overview ¶
Package merkle - merkle tree manipulation routines
Index ¶
Constants ¶
const DigestLength = 32
DigestLength - number of bytes in the digest
Variables ¶
This section is empty.
Functions ¶
func DigestFromBytes ¶
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
Digest - 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 ¶
FullMerkleTree - compute merkle root from a set of transaction ids
structure is:
- N * transaction digests
- level 1..m digests
- merkle root digest
func (Digest) GoString ¶
GoString - convert a binary digest to Big Endian hex string for use by the fmt package (for %#v)
func (Digest) MarshalText ¶
MarshalText - convert digest to Little Endian hex text
func (*Digest) Scan ¶
Scan - convert a Big Endian hex representation to a digest for use by the format package scan routines
func (Digest) String ¶
String - convert a binary digest to Big Endian hex string for use by the fmt package (for %s)
func (*Digest) UnmarshalText ¶
UnmarshalText - convert Little Endian hex text into a digest