Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Hash defines the hash function that is used to compute the PoW digest. Hash = crypto.BLAKE2b_256 // HashLength defines the length of the hash function in bytes. HashLength = blake2b.Size256 // NonceLength defines the length of the nonce in bytes. NonceLength = serializer.UInt64ByteSize // MaxTrailingZeros defines the maximum amount of trailing zeros. MaxTrailingZeros = serializer.UInt64ByteSize * 8 )
Variables ¶
View Source
var ( // ErrCanceled gets returned when the context for the PoW was canceled. ErrCanceled = ierrors.New("canceled") // ErrDone gets returned when the PoW was done but no valid nonce was found. ErrDone = ierrors.New("done") // ErrInvalidTargetTrailingZeroes gets returned when an invalid target trailing zeroes parameter was set. ErrInvalidTargetTrailingZeroes = ierrors.New("invalid target trailing zeros") )
Functions ¶
func TrailingZeros ¶
TrailingZeros returns amount of trailing zeros for the hash of the given msg and nonce.
Types ¶
Click to show internal directories.
Click to hide internal directories.