sha256

package
v0.0.0-...-ee99c87 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2018 License: LGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Worker

type Worker struct {
	Data   []byte
	Nonce  string
	Target *big.Int
}

Worker data is a pointer to the target block data, target is the goal, which means we need to mine a result and its hash must be less than the target.

func (*Worker) PrepareData

func (worker *Worker) PrepareData(nonce string) []byte

PrepareData Constructs the data that need to be verfied.

func (*Worker) Produce

func (worker *Worker) Produce() string

Produce Loop nonce to find the target value that meet the requirement.

func (*Worker) Validate

func (worker *Worker) Validate() bool

Validate Verify nonce to find the target value that meet the requirement.

Jump to

Keyboard shortcuts

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