pow

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2025 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ProofOfWork

type ProofOfWork struct {
	Difficulty int
}

ProofOfWork represents the structure of our PoW

func NewProofOfWork

func NewProofOfWork(difficulty int) *ProofOfWork

NewProofOfWork creates a new ProofOfWork with a given difficulty

func (*ProofOfWork) FindNonce

func (pow *ProofOfWork) FindNonce(message string) (int, string)

FindNonce finds a nonce that solves the PoW challenge

func (*ProofOfWork) Validate

func (pow *ProofOfWork) Validate(message string, nonce int) bool

Validate checks if a given nonce solves the challenge for a message

Jump to

Keyboard shortcuts

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