Documentation
¶
Overview ¶
Package pow is the shared leading-zero SHA-256 work unit. purpose is only a label; bits are the cost. Not used in handshakes or DHT.
Index ¶
- Constants
- func Hash(purpose string, from, to a2al.Address, ts int64, nonce []byte) [32]byte
- func LeadingZeros(sum [32]byte) int
- func Solve(ctx context.Context, purpose string, from, to a2al.Address, ts int64, bits int) ([]byte, error)
- func Verify(purpose string, from, to a2al.Address, ts int64, nonce []byte, bits int) bool
Constants ¶
View Source
const ( // Domain is the hash prefix. A trailing 0x00 separates it from purpose. Domain = "a2al-pow-v1" // DefaultBits is the system default difficulty. 0 means off. DefaultBits = 8 )
Variables ¶
This section is empty.
Functions ¶
func LeadingZeros ¶
LeadingZeros returns the number of leading zero bits in sum.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.