pow

package
v0.0.0-...-c6724dc Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Verify

func Verify(hash string, zerosCount int) bool

Types

type HashCashData

type HashCashData struct {
	Version    int    `json:"version"`
	ZerosCount int    `json:"zerosCount"`
	Date       int64  `json:"s_date"`
	Resource   string `json:"resource"`
	Rand       string `json:"rand"`
	Counter    int    `json:"counter"`
}

func (HashCashData) Compute

func (h HashCashData) Compute(maxIterations int) (string, error)

type POW

type POW interface {
	Check() bool              // Check - checks that hash has leading <zerosCount> zeros
	Compute() (string, error) // Compute - bruteforce calculation correct POW
}

Jump to

Keyboard shortcuts

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