blockdigest

package
v0.8.5 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2018 License: ISC Imports: 6 Imported by: 0

Documentation

Overview

implementation block header hashing

using a memory intensive argon2-d algorithm

Index

Constants

View Source
const Length = 32

number of bytes in the digest

Variables

This section is empty.

Functions

func DigestFromBytes

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

convert and validate little endian binary byte slice to a digest

Types

type Digest

type Digest [Length]byte

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

create a digest from a byte slice

func (Digest) Cmp

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

convert the hash to its equivalent big.Int

func (Digest) GoString

func (digest Digest) GoString() string

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

func (Digest) MarshalText

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

convert digest to little endian hex text

func (*Digest) Scan

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

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

func (Digest) String

func (digest 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

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

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