ofWork

package
v0.0.0-...-ddb2dd3 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const Difficulty = 12

Variables

This section is empty.

Functions

func ToHex

func ToHex(num int64) []byte

Types

type ProofOfWork

type ProofOfWork struct {
	Target *big.Int
}

func Init

func Init() *ProofOfWork

func (*ProofOfWork) InitNonce

func (pow *ProofOfWork) InitNonce(nonce int, block *block.Block) []byte

func (*ProofOfWork) Run

func (pow *ProofOfWork) Run(Hash []byte, Data []byte, PrevHash []byte, Nonce int) (int, []byte)

func (*ProofOfWork) Validate

func (pow *ProofOfWork) Validate(Hash []byte, Data []byte, PrevHash []byte, Nonce int) bool

Jump to

Keyboard shortcuts

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