Documentation ¶
Overview ¶
Package common contains various helper functions.
Index ¶
- func Bytes2Hex(d []byte) string
- func CopyBytes(b []byte) (copiedBytes []byte)
- func CreateDirIfNotExist(dir string) error
- func FromHex(s string) []byte
- func Hash(size int, data ...[]byte) []byte
- func Hash256(data ...[]byte) []byte
- func Hex2Bytes(str string) []byte
- func Hex2BytesFixed(str string, flen int) []byte
- func Hex32ToBytes(s string) [32]byte
- func Hex64ToBytes(s string) [64]byte
- func HexToBytes(s string) []byte
- func LeftPadBytes(slice []byte, l int) []byte
- func ReverseBytes(str []byte) (result []byte)
- func RightPadBytes(slice []byte, l int) []byte
- func ToHex(b []byte) stringdeprecated
- func TrimQuotes(s string) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDirIfNotExist ¶
CreateDirIfNotExist create given folder
func FromHex ¶
FromHex returns the bytes represented by the hexadecimal string s. s may be prefixed with "0x".
func Hex2BytesFixed ¶
Hex2BytesFixed returns bytes of a specified fixed length flen.
func Hex32ToBytes ¶
func Hex64ToBytes ¶
func HexToBytes ¶
func LeftPadBytes ¶
LeftPadBytes zero-pads slice to the left up to length l.
func ReverseBytes ¶
func RightPadBytes ¶
RightPadBytes zero-pads slice to the right up to length l.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.