word256

package
v0.16.3 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2017 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const Word256Length = 32

Variables

View Source
var (
	Zero256 = Word256{0}
	One256  = Word256{1}
)

Functions

func Fingerprint

func Fingerprint(slice []byte) []byte

func GetInt64BE

func GetInt64BE(src []byte) int64

func GetInt64LE

func GetInt64LE(src []byte) int64

func GetUint64BE

func GetUint64BE(src []byte) uint64

func GetUint64LE

func GetUint64LE(src []byte) uint64

func Int64FromWord256

func Int64FromWord256(word Word256) int64

func IsZeros

func IsZeros(slice []byte) bool

func LeftPadBytes

func LeftPadBytes(slice []byte, l int) []byte

func PutInt64BE

func PutInt64BE(dest []byte, i int64)

func PutInt64LE

func PutInt64LE(dest []byte, i int64)

func PutUint64BE

func PutUint64BE(dest []byte, i uint64)

func PutUint64LE

func PutUint64LE(dest []byte, i uint64)

func RightPadBytes

func RightPadBytes(slice []byte, l int) []byte

func SearchUint64s

func SearchUint64s(a []uint64, x uint64) int

func TrimmedString

func TrimmedString(b []byte) string

func Tuple256Split

func Tuple256Split(t Tuple256) (Word256, Word256)

func Uint64FromWord256

func Uint64FromWord256(word Word256) uint64

Types

type Tuple256

type Tuple256 struct {
	First  Word256
	Second Word256
}

func (Tuple256) Compare

func (tuple Tuple256) Compare(other Tuple256) int

type Tuple256Slice

type Tuple256Slice []Tuple256

func (Tuple256Slice) Len

func (p Tuple256Slice) Len() int

func (Tuple256Slice) Less

func (p Tuple256Slice) Less(i, j int) bool

func (Tuple256Slice) Sort

func (p Tuple256Slice) Sort()

func (Tuple256Slice) Swap

func (p Tuple256Slice) Swap(i, j int)

type Uint64Slice

type Uint64Slice []uint64

func (Uint64Slice) Len

func (p Uint64Slice) Len() int

func (Uint64Slice) Less

func (p Uint64Slice) Less(i, j int) bool

func (Uint64Slice) Search

func (p Uint64Slice) Search(x uint64) int

func (Uint64Slice) Sort

func (p Uint64Slice) Sort()

func (Uint64Slice) Swap

func (p Uint64Slice) Swap(i, j int)

type Word256

type Word256 [Word256Length]byte

func Int64ToWord256

func Int64ToWord256(i int64) Word256

func LeftPadWord256

func LeftPadWord256(bz []byte) (word Word256)

func RightPadWord256

func RightPadWord256(bz []byte) (word Word256)

func Uint64ToWord256

func Uint64ToWord256(i uint64) Word256

func (Word256) Bytes

func (w Word256) Bytes() []byte

func (Word256) Compare

func (w Word256) Compare(other Word256) int

func (Word256) Copy

func (w Word256) Copy() Word256

func (Word256) IsZero

func (w Word256) IsZero() bool

func (Word256) Postfix

func (w Word256) Postfix(n int) []byte

func (Word256) Prefix

func (w Word256) Prefix(n int) []byte

func (Word256) String

func (w Word256) String() string

func (Word256) TrimmedString

func (w Word256) TrimmedString() string

Jump to

Keyboard shortcuts

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