Documentation ¶
Index ¶
- func Bech32DecodeBytes(rawString string) (hrp string, decodedKey []byte, err error)
- func Bech32EncodeBytes(toEncode []byte, hrp string) (encodedBytes string, err error)
- func CreateDoubleSha256(data []byte) []byte
- func CreateSha256Hash(data []byte) []byte
- func GenerateRandomBytes(n int) ([]byte, error)
- func PrngIsAvailable() bool
- func TLVRecordToBytes(record ...tlv.Record) []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bech32DecodeBytes ¶
Bech32DecodeBytes decodes a bech32 string.
func Bech32EncodeBytes ¶
Bech32EncodeBytes encodes a bech32 string.
func CreateDoubleSha256 ¶
CreateDoubleSha256 creates a double sha256 hash from data.
func CreateSha256Hash ¶
CreateSha256Hash creates a hash from data.
func GenerateRandomBytes ¶
GenerateRandomBytes returns securely generated random bytes. It will return an error if the system's secure random number generator fails to function correctly, in which case the caller should not continue.
func PrngIsAvailable ¶
func PrngIsAvailable() bool
PrngIsAvailable determines wether or not pseudo-random number generation is available on this device. Adapted from https://git.io/Jt9mW
func TLVRecordToBytes ¶ added in v0.40.0
TLVRecordToBytes encodes a TLV (type-length-value, defined in BOLT #1: https://git.io/JLCRq ) into a byte slice.
Types ¶
This section is empty.