bitmarkd: Index | Files

package blockdigest

import ""

Package blockdigest - implementation block header hashing

using a memory intensive argon2-d algorithm


Package Files

digest.go doc.go


const Length = 32

Length - number of bytes in the digest

func DigestFromBytes Uses

func DigestFromBytes(digest *Digest, buffer []byte) error

DigestFromBytes - convert and validate little endian binary byte slice to a digest

type Digest Uses

type Digest [Length]byte

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 NewDigest Uses

func NewDigest(record []byte) Digest

NewDigest - create a digest from a byte slice

func (Digest) Cmp Uses

func (digest Digest) Cmp(difficulty *big.Int) int

Cmp - convert the hash to its equivalent big.Int

func (Digest) GoString Uses

func (digest Digest) GoString() string

GoString - convert a binary digest to big endian hex string for use by the fmt package (for %#v)

func (Digest) IsEmpty Uses

func (digest Digest) IsEmpty() bool

IsEmpty - is digest empty

func (Digest) IsValidByDifficulty Uses

func (digest Digest) IsValidByDifficulty(diff *difficulty.Difficulty, chainName string) bool

IsValidByDifficulty - is digest valid by difficulty

func (Digest) MarshalText Uses

func (digest Digest) MarshalText() ([]byte, error)

MarshalText - convert digest to little endian hex text

func (*Digest) Scan Uses

func (digest *Digest) Scan(state fmt.ScanState, verb rune) error

Scan - convert a big endian hex representation to a digest for use by the format package scan routines

func (Digest) SmallerDigestThan Uses

func (digest Digest) SmallerDigestThan(target Digest) bool

func (Digest) String Uses

func (digest Digest) String() 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 Uses

func (digest *Digest) UnmarshalText(s []byte) error

UnmarshalText - convert little endian hex text into a digest

Package blockdigest imports 8 packages (graph) and is imported by 17 packages. Updated 2020-03-04. Refresh now. Tools for package owners.