pow

package
v0.0.0-...-03a43c4 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PoW

type PoW interface {
	GetA() string
	Generate() (string, string)
	SetNonce(str string)
	Solve(str string) (string, bool)
	SetSecret(secret string)
	SetDifficulty(level int)
	SetTimestamp(t time.Time)
}

func NewPoW

func NewPoW(secret []byte, nonce []byte, difficulty int, timestamp time.Time) PoW

NewPoW initializes a new instance of the PoW struct.

It takes the following parameters:

  • secret: a byte slice containing the secret value.
  • nonce: a byte slice containing the nonce value.
  • difficulty: an integer representing the difficulty level.
  • timestamp: a time.Time object representing the timestamp.

It returns a PoW interface.

type TimeStamp

type TimeStamp []byte

Jump to

Keyboard shortcuts

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