Documentation ¶
Index ¶
- Variables
- func BinaryStringToBytes(s string) (bs []byte)
- func ByteToBinaryString(b byte) string
- func BytesToBinaryString(bs []byte) string
- func ReadBinaryString(s string, data interface{}) (err error)
- func ToBinaryString(v interface{}) (s string)
- func ToHexString(v interface{}) (s string)
- func ToOctalString(v interface{}) (s string)
- func Uint16ToBinaryString(i uint16) string
- func Uint32ToBinaryString(i uint32) string
- func Uint64ToBinaryString(i uint64) string
Constants ¶
This section is empty.
Variables ¶
var ErrBadStringFormat = errors.New("bad string format")
ErrBadStringFormat represents a error of input string's format is illegal .
var ErrEmptyString = errors.New("empty string")
ErrEmptyString represents a error of empty input string.
var ErrTypeUnsupport = errors.New("data type is unsupported")
Functions ¶
func BinaryStringToBytes ¶
BinaryStringToBytes get the binary bytes according to the input string which is in binary format.
func ByteToBinaryString ¶
ByteToBinaryString get the string in binary format of a byte or uint8.
func BytesToBinaryString ¶
BytesToBinaryString get the string in binary format of a []byte or []int8.
func ReadBinaryString ¶
ReadBinaryString read the string in binary format into input data.
func ToBinaryString ¶
func ToBinaryString(v interface{}) (s string)
ToBinaryString get string in binary format according to input data. The input data can be diffrent kinds of basic data type.
func ToHexString ¶
func ToHexString(v interface{}) (s string)
ToHexString get string in Hexadecimal format according to input data. The input data can be diffrent kinds of basic data type.
func ToOctalString ¶
func ToOctalString(v interface{}) (s string)
ToOctalString get string in octal format according to input data. The input data can be diffrent kinds of basic data type.
func Uint16ToBinaryString ¶
Uint16ToBinaryString get the string of a uint16 number in binary format.
func Uint32ToBinaryString ¶
Uint32ToBinaryString get the string of a uint32 number in binary format.
func Uint64ToBinaryString ¶
Uint64ToBinaryString get the string of a uint64 number in binary format.
Types ¶
This section is empty.