Documentation ¶
Overview ¶
Package hashutil includes all hash-function related helpers for Prysm.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrNilProto = errors.New("cannot hash a nil protobuf message")
ErrNilProto can occur when attempting to hash a protobuf message that is nil or has nil objects within lists.
Functions ¶
func CustomSHA256Hasher ¶
CustomSHA256Hasher returns a hash function that uses an enclosed hasher. This is not safe for concurrent use as the same hasher is being called throughout.
Note: that this method is only more performant over hashutil.Hash if the callback is used more than 5 times.
func FastSum256 ¶
FastSum256 returns a hash sum of the input data using highwayhash. This method is not secure, but may be used as a quick identifier for objects where collisions are acceptable.
func FastSum64 ¶
FastSum64 returns a hash sum of the input data using highwayhash. This method is not secure, but may be used as a quick identifier for objects where collisions are acceptable.
func Hash ¶
Hash defines a function that returns the sha256 checksum of the data passed in. https://github.com/ethereum/consensus-specs/blob/v0.9.3/specs/core/0_beacon-chain.md#hash
func HashKeccak256 ¶
HashKeccak256 defines a function which returns the Keccak-256/SHA3 hash of the data passed in.
Types ¶
This section is empty.