blockdigest

package
v0.15.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 23, 2024 License: ISC Imports: 8 Imported by: 0

Documentation

Overview

Package blockdigest - implementation block header hashing

using a memory intensive argon2-d algorithm

Index

Constants

View Source
const Length = 32

Length - number of bytes in the digest

Variables

This section is empty.

Functions

func DigestFromBytes

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

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

Types

type Digest

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

func NewDigest(record []byte) Digest

NewDigest - create a digest from a byte slice

func (Digest) Cmp

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

Cmp - convert the hash to its equivalent big.Int

func (Digest) GoString

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 added in v0.11.1

func (digest Digest) IsEmpty() bool

IsEmpty - is digest empty

func (Digest) IsValidByDifficulty added in v0.11.0

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

IsValidByDifficulty - is digest valid by difficulty

func (Digest) MarshalText

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

MarshalText - convert digest to little endian hex text

func (*Digest) Scan

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 added in v0.11.0

func (digest Digest) SmallerDigestThan(target Digest) bool

func (Digest) String

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

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

UnmarshalText - convert little endian hex text into a digest

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL