lntypes

package
v0.11.1-beta.rc3 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2020 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

var ZeroHash Hash

ZeroHash is a predefined hash containing all zeroes.

func MakeHash

func MakeHash(newHash []byte) (Hash, error)

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

func MakeHashFromStr

func MakeHashFromStr(newHash string) (Hash, error)

MakeHashFromStr 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 MakePreimage

func MakePreimage(newPreimage []byte) (Preimage, error)

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

func MakePreimageFromStr

func MakePreimageFromStr(newPreimage string) (Preimage, error)

MakePreimageFromStr 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) Matches

func (p *Preimage) Matches(h Hash) bool

Matches returns whether this preimage is the preimage of the given hash.

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