Documentation ¶
Overview ¶
Package sharding is a generated GoMock package.
Index ¶
- Constants
- func Checksum(bytes []byte, length int) []byte
- func ComputeHash160(buf []byte) []byte
- func ComputeHash256(buf []byte) []byte
- func ComputeHash256Ranges(buf []byte, ranges [][2]int) []byte
- func PubkeyBytesToAddress(key []byte) []byte
- type Hash160
- type Hash256
- type Hasher
- type MockHasher
- type MockHasherMockRecorder
Constants ¶
const ( HashLen = sha256.Size AddrLen = ripemd160.Size )
Variables ¶
This section is empty.
Functions ¶
func Checksum ¶
Checksum Create checksum of [length] bytes from the 256 bit hash of the byte slice.
Returns the lower [length] bytes of the hash Errors if length > 32.
func ComputeHash160 ¶
ComputeHash160 Compute a cryptographically strong 160 bit hash of the input
byte slice.
func ComputeHash256 ¶
ComputeHash256 Compute a cryptographically strong 256 bit hash of the input
byte slice.
func ComputeHash256Ranges ¶
ComputeHash256Ranges Compute a cryptographically strong 256 bit hash of the input
byte slice in the ranges specified.
Example: ComputeHash256Ranges({1, 2, 4, 8, 16}, {{1, 2},
{3, 5}}) is equivalent to ComputeHash256({2, 8, 16}).
func PubkeyBytesToAddress ¶
Types ¶
type Hash160 ¶
Hash160 A 160 bit long hash value.
func ComputeHash160Array ¶
ComputeHash160Array Compute a cryptographically strong 160 bit hash of the
input byte slice.
type Hash256 ¶
Hash256 A 256 bit long hash value.
func ComputeHash256Array ¶
ComputeHash256Array Compute a cryptographically strong 256 bit hash of the
input byte slice.
type Hasher ¶ added in v1.7.5
type Hasher interface { // Hash takes a string and computes its hash value. // Values must be computed deterministically. Hash([]byte) uint64 }
Hasher is an interface to compute a hash value.
type MockHasher ¶ added in v1.7.5
type MockHasher struct {
// contains filtered or unexported fields
}
MockHasher is a mock of Hasher interface.
func NewMockHasher ¶ added in v1.7.5
func NewMockHasher(ctrl *gomock.Controller) *MockHasher
NewMockHasher creates a new mock instance.
func (*MockHasher) EXPECT ¶ added in v1.7.5
func (m *MockHasher) EXPECT() *MockHasherMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockHasher) Hash ¶ added in v1.7.5
func (m *MockHasher) Hash(arg0 []byte) uint64
Hash mocks base method.
type MockHasherMockRecorder ¶ added in v1.7.5
type MockHasherMockRecorder struct {
// contains filtered or unexported fields
}
MockHasherMockRecorder is the mock recorder for MockHasher.
func (*MockHasherMockRecorder) Hash ¶ added in v1.7.5
func (mr *MockHasherMockRecorder) Hash(arg0 interface{}) *gomock.Call
Hash indicates an expected call of Hash.