convert

package
v0.0.0-...-7e3dfe9 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsString

func AsString(src interface{}) string

AsString 其他类型转String

func ByteToBinStr

func ByteToBinStr(b byte) string

ByteToBinStr 将byte 以8个bit位的形式展示

func BytesBCC

func BytesBCC(bytes []byte) byte

BytesBCC 计算 BCC

func BytesToBinStr

func BytesToBinStr(bs []byte) string

BytesToBinStr 将byte数组转成8个bit位一组的字符串

func BytesToBinStrWithSplit

func BytesToBinStrWithSplit(bs []byte, split string) string

BytesToBinStrWithSplit 将byte数组转8个bit一组的字符串并且带分割符

func BytesToHex

func BytesToHex(data []byte) string

BytesToHex 字节数组转hex []byte{0x55, 0xAA} 被转成 55AA

func DecToBin

func DecToBin(n uint64) string

DecToBin 十进制转二进制

func DecToHex

func DecToHex(n uint64) string

DecToHex 十进进制转16进制

func GBKSuffixSpace

func GBKSuffixSpace(chinese string, byteSize int) (hex string)

GBKSuffixSpace 编码按字节右补空格

func GBKSuffixZero

func GBKSuffixZero(gbkStr string, byteSize int) string

GBKSuffixZero GBK 编码按字节右补0

func HexBCC

func HexBCC(hexStr string) string

HexBCC 计算BCC校验码

func HexPrefixZero

func HexPrefixZero(hex string, byteSize int) string

func HexReverse

func HexReverse(hex string) string

HexReverse 字节颠倒

func HexSuffixZero

func HexSuffixZero(hex string, byteSize int) string

HexSuffixZero hex 后补位

func HexToBin

func HexToBin(h string) string

HexToBin 16进制转二进制

func HexToBytes

func HexToBytes(hexStr string) []byte

HexToBytes 将hex 字符串转成 byte数组 AABBCC 转成字节数组 []byte{0xAA, 0xBB, 0xCC}

func HexToDec

func HexToDec(h string) uint64

HexToDec 十六进制转10进制

func ReverseString

func ReverseString(s string) string

ReverseString 反转字符串

func StrPrefixSpace

func StrPrefixSpace(str string, length int) string

StrPrefixSpace 字符串前补空格

func StrPrefixZero

func StrPrefixZero(str string, length int) string

StrPrefixZero 字符串前补0

func StrSuffixF

func StrSuffixF(str string, length int) string

StrSuffixF 字符串后补F

func StrSuffixSpace

func StrSuffixSpace(str string, length int) string

StrSuffixSpace 字符串后补空格

func StrSuffixZero

func StrSuffixZero(str string, length int) string

StrSuffixZero 字符串后补0

Types

This section is empty.

Jump to

Keyboard shortcuts

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