util

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2020 License: GPL-3.0, GPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package util contains various helper functions.

Index

Constants

View Source
const (
	STRING_JOIN_CHAR = "\x00"
)

Variables

This section is empty.

Functions

func Bytes

func Bytes(value interface{}) ([]byte, error)

func Bytes2Hex

func Bytes2Hex(d []byte) string

func BytesEqual

func BytesEqual(a, b []byte) bool

YiRan Returns true when the contents of the two []byte are exactly the same

func BytesToInt

func BytesToInt(b []byte) int

func BytesToUInt64 added in v1.0.6

func BytesToUInt64(buf []byte) uint64

func CopyBytes

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

Copy bytes

Returns an exact copy of the provided bytes

func FromHex

func FromHex(s string) []byte

func GetSourceString

func GetSourceString(obj interface{}) string

func Hex2Bytes

func Hex2Bytes(str string) []byte

func Hex2BytesFixed

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

func InsertArray

func InsertArray(a string, arr []string) []string

func IntToBytes

func IntToBytes(n int) []byte

func LeftPadBytes

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

func RHashBytes

func RHashBytes(x interface{}) []byte

func RHashStr

func RHashStr(x interface{}) string

func RightPadBytes

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

func RlpHash

func RlpHash(x interface{}) (h common.Hash)

func ToByte

func ToByte(s string) []byte

func ToHex

func ToHex(b []byte) string

func ToString

func ToString(b []byte) string

func UInt64ToBytes added in v1.0.6

func UInt64ToBytes(i uint64) []byte

Types

This section is empty.

Jump to

Keyboard shortcuts

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