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 ¶
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.
Click to show internal directories.
Click to hide internal directories.