common

package
v1.0.15 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Big0      = big.NewInt(0)
	Big1      = big.NewInt(1)
	Big2      = big.NewInt(2)
	Big3      = big.NewInt(3)
	Big4      = big.NewInt(4)
	Big8      = big.NewInt(8)
	Big16     = big.NewInt(16)
	Big32     = big.NewInt(32)
	Big64     = big.NewInt(64)
	Big96     = big.NewInt(96)
	Big256    = big.NewInt(256)
	Big257    = big.NewInt(257)
	Big480    = big.NewInt(480)
	Big1024   = big.NewInt(1024)
	Big3072   = big.NewInt(3072)
	Big199680 = big.NewInt(199680)
)

Common big integers often used

Functions

func Bytes2Hex

func Bytes2Hex(d []byte) string

Bytes2Hex returns the hexadecimal encoding of d.

func CopyBytes

func CopyBytes(b []byte) (copiedBytes []byte)

CopyBytes returns an exact copy of the provided bytes.

func CreateAddress

func CreateAddress(addr sdk.AccAddress, nonce uint64) sdk.AccAddress

func CreateAddress2

func CreateAddress2(addr sdk.AccAddress, salt [32]byte, inithash []byte) sdk.AccAddress

func FromHex

func FromHex(s string) []byte

FromHex returns the bytes represented by the hexadecimal string s. s may be prefixed with "0x".

func Hex2Bytes

func Hex2Bytes(str string) []byte

Hex2Bytes returns the bytes represented by the hexadecimal string str.

func Hex2BytesFixed

func Hex2BytesFixed(str string, flen int) []byte

Hex2BytesFixed returns bytes of a specified fixed length flen.

func LeftPadBytes

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

LeftPadBytes zero-pads slice to the left up to length l.

func RightPadBytes

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

RightPadBytes zero-pads slice to the right up to length l.

func TrimLeftZeroes

func TrimLeftZeroes(s []byte) []byte

TrimLeftZeroes returns a subslice of s without leading zeroes

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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