xcoding

package
v0.0.0-...-dd6747b Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base64UrlDecoding

func Base64UrlDecoding(src string) ([]byte, error)

Base64URL解码

func Base64UrlEncoding

func Base64UrlEncoding(src string) string

用于URL参数传输时的编解码,如果要用在url中,需要使用URLEncoding

func DecodeBase64FromString

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

base64字符串解码

func DecodeFromCSVFile

func DecodeFromCSVFile(sourceCSVFile string) (records [][]string, err error)

func DecodeFromJsonFile

func DecodeFromJsonFile(sourceJsonFile string, v interface{}) error

解码json文件到go数据类型

func DecodeFromYamlFile

func DecodeFromYamlFile(sourceYamlFile string, v interface{}) error

解码Yaml文件到go数据类型

func DecodeHex

func DecodeHex(dst, src []byte) (int, error)

将src解码为DecodedLen(len(src))字节,返回实际写入dst的字节数;如遇到非法字符,返回描述错误的error。

func DecodeHexFromString

func DecodeHexFromString(hexStr string) ([]byte, error)

返回hex编码的字符串hexStr解码的数据,入参字符串需事先被hex编码过

func EncodeBase64ToString

func EncodeBase64ToString(src string) string

base64字符串编码

func EncodeHex

func EncodeHex(dst, src []byte) int

将src的数据编码为EncodedLen(len(src))字节,返回实际写入dst的字节数:EncodedLen(len(src))。

func EncodeHexToString

func EncodeHexToString(src []byte) string

返回十六进制字符编码成的字符串

func EncodeToCSVFile

func EncodeToCSVFile(data [][]string, targetCSVFile string) error

func EncodeToJsonFile

func EncodeToJsonFile(data interface{}, targetJsonFile string) error

编码go数据类型到json文件

func EncodeToYamlFile

func EncodeToYamlFile(data interface{}, targetYamlFile string) error

编码go数据类型到Yaml文件

func JsonMarshalToString

func JsonMarshalToString(data interface{}) (string, error)

go数据类型序列化为json字符串

func JsonUnMarshalFromString

func JsonUnMarshalFromString(jsonStr string, v interface{}) error

json字符串反序列化为go数据类型

Types

This section is empty.

Jump to

Keyboard shortcuts

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