ticket

package
v0.0.0-...-f533ddb Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IDFromBytes32

func IDFromBytes32(id [32]byte) (ksuid.KSUID, error)

IDFromBytes32 converts

func IDToBytes32

func IDToBytes32(kid ksuid.KSUID) [32]byte

IDToBytes32 is used to pad a ksuid to 32 bytes

func NewSeed

func NewSeed() ([32]byte, error)

Types

type Ticket

type Ticket struct {
	Seed       [32]byte  `json:"seed"`
	Difficulty int       `json:"difficulty"`
	Proof      [516]byte `json:"proof"`
}

func FromBytes

func FromBytes(data []byte) (*Ticket, error)

func NewTicket

func NewTicket(diff int) (*Ticket, error)

func (*Ticket) Encode

func (t *Ticket) Encode() (string, error)

func (*Ticket) Hash

func (t *Ticket) Hash() string

func (*Ticket) Marshal

func (t *Ticket) Marshal() ([]byte, error)

func (*Ticket) Solve

func (t *Ticket) Solve() [516]byte

func (*Ticket) Verify

func (t *Ticket) Verify(proof [516]byte) bool

Jump to

Keyboard shortcuts

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