Documentation ¶
Index ¶
- func BytesCombine(pBytes ...[]byte) []byte
- func Contain(target interface{}, obj interface{}) bool
- func FixBytesLength(bytes []byte, length int) []byte
- func GetDataBig(data []byte, start *big.Int, size *big.Int) []byte
- func Hex(data []byte) string
- func Hex2Bytes(str string) []byte
- func HexToBytes(s string) ([]byte, error)
- func LeftPadBytes(slice []byte, l int) []byte
- func Log256(x *big.Int) int
- func RandNum(max int) int
- func ReadBinFile(path string) ([]byte, error)
- func RightPadBytes(slice []byte, l int) []byte
- func SubSlice(data []byte, offset, length uint64) ([]byte, error)
- func Uint64ToBytes(i uint64) []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Contain ¶
func Contain(target interface{}, obj interface{}) bool
Contain return if the target which is a map or slice contains the obj
func FixBytesLength ¶
FixBytesLength fix bytes to bytes which length is length
func GetDataBig ¶
getDataBig returns a slice from the data based on the start and size and pads up to size with zero's. This function is overflow safe.
func Hex2Bytes ¶
Hex2Bytes returns the bytes represented by the hexadecimal string str. Note: The function is a wrapper of hex.DecodeString, but it ignore the error.
func HexToBytes ¶
HexToBytes will remove 0x or 0X of begin ,and then call hex.DecodeString
func ReadBinFile ¶
ReadBinFile read code from bin file
func SubSlice ¶
SubSlice returns a subslice from offset of length length and a bool (true iff slice was possible). If the subslice extends past the end of data it returns A COPY of the segment at the end of data padded with zeroes on the right. If offset == len(data) it returns all zeroes. if offset > len(data) it returns a false
Types ¶
This section is empty.