Documentation
¶
Index ¶
- Constants
- Variables
- func CountLeadingBits(s []byte) (n int)
- func LogDifficulty(algo hash.Hash, peers int64) (x uint64)
- func New(ctx context.Context, h hash.Hash, bits uint64, salt, payload string) (hc string, err error)
- func SqrtDifficulty(algo hash.Hash, peers int64) (x uint64)
- func Verify(h hash.Hash, hc string) (err error)
- func VerifyWithDifficultyAndPayload(h hash.Hash, hc string, difficulty uint64, payload string) (err error)
Constants ¶
View Source
const DefaultMaxDifficulty = 32 // Can be modified by the compiler
Variables ¶
View Source
var DefaultHashAlgorithm = sha3.New512
Functions ¶
func CountLeadingBits ¶
func New ¶
func New(ctx context.Context, h hash.Hash, bits uint64, salt, payload string) (hc string, err error)
Creates a hashcash (hc) hash is reset on every try
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.