conv

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2015 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HEX  = "0123456789ABCDEF"
	LHEX = "0123456789abcdef"
)

Variables

This section is empty.

Functions

func AtoiDef added in v0.2.3

func AtoiDef(val string, def int) int

func Bytes2Hex

func Bytes2Hex(src []byte) []byte

BytesToHex transfer binary to hex bytes

func Hex2Bytes

func Hex2Bytes(src []byte) []byte

HexToBytes transfer hex bytes to binary

func Hex2Uint

func Hex2Uint(str string) (uint64, error)

Hex2Uint convert a hexadecimal string to uint if string is invalid, return an error

func IfaceToInt added in v0.2.3

func IfaceToInt(v interface{}) (int, error)

func IfaceToInt64 added in v0.2.3

func IfaceToInt64(v interface{}) (int64, error)

func ReverseBits

func ReverseBits(num uint) uint

ReverseBits reverse all bits in number

func ReverseByte

func ReverseByte(num byte) byte

ReverseByte reverse all bits for a byte

func Uint2Hex

func Uint2Hex(u uint64) []byte

func Uint2LowerHex

func Uint2LowerHex(u 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