Documentation ¶
Index ¶
- Constants
- func ByteArraysToHash256Array(byteArray ...[]byte) [32]byte
- 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
Constants ¶
const AddrLen = ripemd160.Size
AddrLen ...
const HashLen = sha256.Size
HashLen ...
Variables ¶
This section is empty.
Functions ¶
func ByteArraysToHash256Array ¶
ByteArraysToHash256Array takes in byte arrays and outputs a fixed 32 length
byte array for the hash
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}).
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.