operation

package
v0.0.0-...-a0620fb Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Fork = iota + 1
	Sha1
	Sha256
	Keccak256
	Ripemd160
	Append
	Prepend
	Attestation
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Op

type Op struct {
	Kind         int
	DigestLength int
	Apply        func([]byte) []byte
}

Op is the type of an operation done on a timestamp.

func NewFork

func NewFork() *Op

func NewOpAppend

func NewOpAppend(data []byte) *Op

NewOpAppend append a byte array to the byte array.

func NewOpKeccak256

func NewOpKeccak256() *Op

NewOpKeccak256 is the sha3.Sum256 operation checkSum.

func NewOpPrepend

func NewOpPrepend(data []byte) *Op

NewOpPrepend prepend a byte array to the byte array.

func NewOpRipemd160

func NewOpRipemd160() *Op

NewOpRipemd160 is the sha256 operation checkSum. golang/x/crypto Ripemd160 does not return error, Output of hash.Write can be ignored.

func NewOpSha1

func NewOpSha1() *Op

NewOpSha1 is the sha1 operation checkSum.

func NewOpSha256

func NewOpSha256() *Op

NewOpSha256 is the sha256 operation checkSum.

func (Op) Exec

func (o Op) Exec(input []byte) []byte

Exec execute the operation

func (Op) Length

func (o Op) Length() int

Length returns the operation lenght

func (Op) Match

func (o Op) Match(i int) bool

type Operation

type Operation interface {
	Match(int) bool
	Exec(input []byte) []byte
}

Jump to

Keyboard shortcuts

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