hashing
Package hashing is a generated GoMock package.
import "github.com/luxfi/node/utils/hashing"Package hashing is a generated GoMock package.
Functions
Checksum
func Checksum(bytes []byte, length int) []byteChecksum creates a checksum of [length] bytes from the 256 bit hash of the byte slice.
Returns: the lower [length] bytes of the hash Panics if length > 32.
ComputeHash160
func ComputeHash160(buf []byte) []byteComputeHash160 computes a cryptographically strong 160 bit hash of the input byte slice.
ComputeHash256
func ComputeHash256(buf []byte) []byteComputeHash256 computes a cryptographically strong 256 bit hash of the input byte slice.
PubkeyBytesToAddress
func PubkeyBytesToAddress(key []byte) []bytePubkeyBytesToAddress converts a public key to an address using Bitcoin-style SHA256+RIPEMD160 hash.
Types
Hash160
Hash160 A 160 bit long hash value.
func ComputeHash160Array(buf []byte) Hash160func ToHash160(bytes []byte) (Hash160, error)Hash256
Hash256 A 256 bit long hash value.
func ComputeHash256Array(buf []byte) Hash256func ToHash256(bytes []byte) (Hash256, error)Hasher
Hasher is an interface to compute a hash value.
MockHasher
MockHasher is a mock of Hasher interface.
func NewMockHasher(ctrl *gomock.Controller) *MockHasherfunc (m *MockHasher) EXPECT() *MockHasherMockRecorderfunc (m *MockHasher) Hash(arg0 []byte) uint64MockHasherMockRecorder
MockHasherMockRecorder is the mock recorder for MockHasher.
func (mr *MockHasherMockRecorder) Hash(arg0 any) *gomock.Call