Documentation ¶
Overview ¶
Implementation of Bitcoin-specific hash functions, including SHA-256, RIPEMD-160 (Hash160), and TaggedHash.
Index ¶
- func DoubleHash(buffer []byte) []byte
- func GenerateRandom(size int) ([]byte, error)
- func Hash160(buffer []byte) []byte
- func HmacSHA512(key, data []byte) []byte
- func PbkdfDeriveDigest(mnemonic string, salt string) []byte
- func SingleHash(data []byte) []byte
- func TaggedHash(data []byte, tag string) []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DoubleHash ¶
DoubleHash computes the SHA-256 hash of data twice, returning the resulting hash.
func GenerateRandom ¶
GenerateRandom creates a byte slice of the specified 'size' containing random data. It generates 'size' random bytes using the crypto/rand package's rand.Read function and returns the resulting byte slice. If any error occurs during the random data generation, it is returned as an error along with a nil byte slice.
The function is suitable for generating cryptographically secure random data.
func HmacSHA512 ¶
HmacSHA512 computes the HMAC-SHA-512 hash of the given key and data.
func PbkdfDeriveDigest ¶
PbkdfDeriveDigest generates a derived key using the PBKDF2 algorithm with HMAC-SHA-512.
func TaggedHash ¶
TaggedHash computes a tagged hash by prepending a tag byte to the input data
Types ¶
This section is empty.