Documentation
¶
Overview ¶
Package hashcash implements the hashcash algorithm
Index ¶
- Constants
- Variables
- func BitCount(d [32]byte) byte
- func ComputeNonce(d []byte, bits byte, c, stop uint64) (nonce []byte, ok bool)
- func ComputeNonceParallel(d []byte, bits byte, start, stop uint64) (nonce []byte, ok bool)
- func ComputeNonceSelect(d []byte, bits byte, start, stop uint64) (nonce []byte, ok bool)
- func NonceToUInt64(nonce []byte) uint64
- func TestNonce(d, nonce []byte, bits byte) (bool, byte)
Constants ¶
View Source
const NonceSize = 8
NonceSize is the size of a hashcash nonce
View Source
const Version = "0.0.1 very alpha"
Version of this release
Variables ¶
View Source
var ( // Steps is the number of steps per thread per cycle Steps = uint64(4194304) // SingleThreadBits Number of bits required for parallel computing SingleThreadBits = byte(20) )
Functions ¶
func ComputeNonce ¶
ComputeNonce is the hashcash algorithm c is the start value for calculation, stop is the end value. Both can be 0 to ignore segemented calculations
func ComputeNonceParallel ¶
ComputeNonceParallel parallel compute hashcash
func ComputeNonceSelect ¶
ComputeNonceSelect calls parallel or single compute depending on bits
func NonceToUInt64 ¶
NonceToUInt64 converts a nonce back to uint64
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.