Documentation ¶
Overview ¶
Package blockdigest - implementation block header hashing
using a memory intensive argon2-d algorithm
Index ¶
- Constants
- func DigestFromBytes(digest *Digest, buffer []byte) error
- type Digest
- func (digest Digest) Cmp(difficulty *big.Int) int
- func (digest Digest) GoString() string
- func (d Digest) IsEmpty() bool
- func (d Digest) IsValidByDifficulty(diff *difficulty.Difficulty) bool
- func (digest Digest) MarshalText() ([]byte, error)
- func (digest *Digest) Scan(state fmt.ScanState, verb rune) error
- func (d Digest) SmallerDigestThan(target Digest) bool
- func (digest Digest) String() string
- func (digest *Digest) UnmarshalText(s []byte) error
Constants ¶
const Length = 32
Length - 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
Types ¶
type Digest ¶
Digest - type for a digest stored as little endian byte array represented as big endian hex value for print represented as little endian hex text for JSON encoding
func (Digest) GoString ¶
GoString - convert a binary digest to big endian hex string for use by the fmt package (for %#v)
func (Digest) IsValidByDifficulty ¶ added in v0.11.0
func (d Digest) IsValidByDifficulty(diff *difficulty.Difficulty) bool
IsValidByDifficulty - is digest valid by difficulty
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) SmallerDigestThan ¶ added in v0.11.0
func (Digest) String ¶
String - convert a binary digest to hex string for use by the fmt package (for %s)
the stored version is in little endian, but the output string is big endian
func (*Digest) UnmarshalText ¶
UnmarshalText - convert little endian hex text into a digest