lntypes

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const HashSize = 32

HashSize of array used to store hashes.

View Source
const PreimageSize = 32

PreimageSize of array used to store preimagees.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hash

type Hash [HashSize]byte

Hash is used in several of the lightning messages and common structures. It typically represents a payment hash.

func NewHash

func NewHash(newHash []byte) (*Hash, error)

NewHash returns a new Hash from a byte slice. An error is returned if the number of bytes passed in is not HashSize.

func NewHashFromStr

func NewHashFromStr(newHash string) (*Hash, error)

NewHashFromStr creates a Hash from a hex hash string.

func (Hash) String

func (hash Hash) String() string

String returns the Hash as a hexadecimal string.

type Preimage

type Preimage [PreimageSize]byte

Preimage is used in several of the lightning messages and common structures. It represents a payment preimage.

func NewPreimage

func NewPreimage(newPreimage []byte) (*Preimage, error)

NewPreimage returns a new Preimage from a byte slice. An error is returned if the number of bytes passed in is not PreimageSize.

func NewPreimageFromStr

func NewPreimageFromStr(newPreimage string) (*Preimage, error)

NewPreimageFromStr creates a Preimage from a hex preimage string.

func (*Preimage) Hash

func (p *Preimage) Hash() Hash

Hash returns the sha256 hash of the preimage.

func (Preimage) String

func (p Preimage) String() string

String returns the Preimage as a hexadecimal string.

Jump to

Keyboard shortcuts

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