encoding

package
v0.0.0-...-021ab65 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: MIT Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UTF8    = charset("UTF-8")
	GB18030 = charset("GB18030")
)

Variables

This section is empty.

Functions

func AESDecrypt

func AESDecrypt(crypt, key []byte) []byte

func AESEncrypt

func AESEncrypt(origData, key []byte) []byte

func AsciiToChar

func AsciiToChar(i int) string

AsciiToChar ASCII码转字符

func AsciiToStr

func AsciiToStr(str string) (string, error)

AsciiToStr ASCII码转字符串

func BinDec

func BinDec(b string) (n int64, err error)

BinDec 二进制转十进制

func BinHex

func BinHex(b string) (string, error)

BinHex 二进制转十六进制

func BinOct

func BinOct(b string) (int64, error)

BinOct 二进制转八进制

func ByteCountIEC

func ByteCountIEC(b int64) string

ByteCountIEC 将字节转化为更易读

func Compression

func Compression(oriData []byte) []byte

func ConvertByte

func ConvertByte(b []byte, charset charset) []byte

ConvertByte 将b charset转换为UTF-8编码

func DecBin

func DecBin(n int64) string

DecBin 十进制转二进制

func DecHex

func DecHex(n int64) (string, error)

DecHex 十进制转十六进制

func DecOct

func DecOct(d int64) (int64, error)

DecOct 十进制转八进制

func DecodeBase64

func DecodeBase64(value string) (string, error)

func DecodeHtml

func DecodeHtml(htmlStr string) string

func DecodePacked

func DecodePacked(value string) (string, error)

func DecodeRsa

func DecodeRsa(data string) (string, error)

DecodeRsa 解密

func DecodeURI

func DecodeURI(value string) (string, error)

func Decompress

func Decompress(oriData []byte) []byte

func EncodeBase64

func EncodeBase64(value string) string

func EncodeHtml

func EncodeHtml(htmlStr string) string

func EncodePacked

func EncodePacked(value string) (string, error)

EncodePacked 将内容编码为

func EncodeRsa

func EncodeRsa(data []byte) (string, error)

EncodeRsa 加密

func EncodeURI

func EncodeURI(value string) string

func Escape

func Escape(value string) (string, error)

func GBKToUtf8

func GBKToUtf8(gbkStr string) (string, error)

func GenRandomString

func GenRandomString(l int) string

GenRandomString 随机生成字符串

func GetRsaPublicKey

func GetRsaPublicKey() string

GetRsaPublicKey 获取公钥

func HexBin

func HexBin(h string) (string, error)

HexBin 十六进制转二进制

func HexDec

func HexDec(h string) (n int64, err error)

HexDec 十六进制转十进制

func HexOct

func HexOct(h string) (int64, error)

HexOct 十六进制转八进制

func HexStr

func HexStr(str string) (string, string, string)

HexStr 十六进制字符串

func HtmlEscape

func HtmlEscape(htmlStr string) string

HtmlEscape HTML转义

func HtmlUnescape

func HtmlUnescape(str string) (string, error)

HtmlUnescape HTML反转义

func IPString2Long

func IPString2Long(ip string) (uint, error)

IPString2Long 把ip字符串转为数值

func Interface2String

func Interface2String(i interface{}) string

Interface2String interface转string

func LoadRsaPrivateKey

func LoadRsaPrivateKey(pemData []byte)

LoadRsaPrivateKey 加载rsa私钥

func Long2IPString

func Long2IPString(i uint) (string, error)

Long2IPString 把数值转为ip字符串

func MssqlStrToString

func MssqlStrToString(mssqlStr string) string

MssqlStrToString mssql字符串转字符串

func OctBin

func OctBin(o int64) (string, error)

OctBin 八进制转二进制

func OctDec

func OctDec(o int64) (n int64, err error)

OctDec 八进制转十进制

func OctHex

func OctHex(o int64) (string, error)

OctHex 八进制转十六进制

func OracleStrToString

func OracleStrToString(oracleStr string) string

OracleStrToString oracle字符串转字符串

func PKCS7Padding

func PKCS7Padding(origData []byte, blockSize int) []byte

func PKCS7UnPadding

func PKCS7UnPadding(origData []byte) []byte

func PaserRsaPublicKey

func PaserRsaPublicKey(pemData string) *rsa.PublicKey

PaserRsaPublicKey 解析rsa公钥

func StcFieldTagMap

func StcFieldTagMap(v reflect.Value, tagName string, tf map[string]string)

StcFieldTagMap 获取struct字段名与tag的映射关系,并存储到tf中(map[tag]name)

func StrHex

func StrHex(str string) (string, error)

func StrToASCII

func StrToASCII(str string) string

StrToASCII 字符转ASCII码

func StringFromCharCode

func StringFromCharCode(str string) string

StringFromCharCode String.fromCharCode

func StringToMssqlStr

func StringToMssqlStr(str string) string

StringToMssqlStr 字符串转mssql字符串

func StringToOracleStr

func StringToOracleStr(str string) string

StringToOracleStr 字符串转oracle字符串

func StringToUnicode

func StringToUnicode(value string) (string, string)

StringToUnicode 中文转unicode编码

func URICompCoding

func URICompCoding(value string) string

func URICompDecoding

func URICompDecoding(value string) (string, error)

func URLEscape

func URLEscape(path string, escapeSlash bool) string

URLEscape URL编码

func URLUnescape

func URLUnescape(path string) string

URLUnescape URL解码

func UnStringFromCharCode

func UnStringFromCharCode(str string) (string, error)

func Unescape

func Unescape(value string) (string, error)

func UnicodeToString

func UnicodeToString(form string) (to string, err error)

UnicodeToString unicode编码转中文

func Utf8ToGBK

func Utf8ToGBK(utf8str string) (string, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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