blockchain

package
v0.0.0-...-2f46974 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SolutionSize = 16
	PuzzleSize   = 16
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Puzzle

type Puzzle struct {
	Complexity uint8
	Value      []byte
}

func NewPuzzle

func NewPuzzle(complexity uint8) *Puzzle

type PuzzleSolution

type PuzzleSolution []byte

type PuzzleSolver

type PuzzleSolver struct {
	Puzzle          *Puzzle
	PrecomputedHash hash.Hash
}

func NewPuzzleSolver

func NewPuzzleSolver(p *Puzzle) *PuzzleSolver

func (*PuzzleSolver) IsValidSolution

func (ps *PuzzleSolver) IsValidSolution(solution PuzzleSolution) bool

func (*PuzzleSolver) Solve

func (ps *PuzzleSolver) Solve() SolvingResult

type SolvingResult

type SolvingResult struct {
	Solution  PuzzleSolution
	HashTried int
}

Jump to

Keyboard shortcuts

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