encoding/hex 官方文档
https://studygolang.com/static/pkgdoc/pkg/encoding_hex.htm#Encode
func EncodedLen(n int) int
长度x的明文数据编码后的编码数据的长度。
func Encode(dst, src []byte) int
将src的数据解码为EncodedLen(len(src))字节,返回实际写入dst的字节数:EncodedLen(len(src))。
func EncodeToString(src []byte) string
将数据src编码为字符串s。
func DecodedLen(x int) int
长度x的编码数据 解码后的明文数据的长度
func Decode(dst, src []byte) (int, error)
将 src 解码为 DecodedLen(len(src)) 字节,返回实际写入dst 的字节数;如遇到非法字符,返回描述错误的error。
func DecodeString(s string) ([]byte, error)
返回hex编码的字符串s代表的数据,实际就是把字符串转化为16进制数。如 Hello world! 的字符串16进制值为 48656c6c6f20776f726c6421
package main
import (
"encoding/hex"
"fmt"
)
func main() {
srccode :