util

package
v0.87.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 30, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bech32DecodeBytes

func Bech32DecodeBytes(rawString string) (hrp string, decodedKey []byte, err error)

Bech32DecodeBytes decodes a bech32 string.

func Bech32EncodeBytes

func Bech32EncodeBytes(toEncode []byte, hrp string) (encodedBytes string, err error)

Bech32EncodeBytes encodes a bech32 string.

func CreateDoubleSha256

func CreateDoubleSha256(data []byte) []byte

CreateDoubleSha256 creates a double sha256 hash from data.

func CreateSha256Hash

func CreateSha256Hash(data []byte) []byte

CreateSha256Hash creates a hash from data.

func GenerateRandomBytes

func GenerateRandomBytes(n int) ([]byte, error)

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

func TLVRecordToBytes(record ...tlv.Record) []byte

TLVRecordToBytes encodes a TLV (type-length-value, defined in BOLT #1: https://git.io/JLCRq ) into a byte slice.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL