1
0
mirror of https://github.com/charlienet/go-mixed.git synced 2025-07-18 08:32:40 +08:00

更新库

This commit is contained in:
2023-10-12 15:02:04 +08:00
parent 1203e27c7e
commit 69690da6b4
8 changed files with 97 additions and 145 deletions

View File

@ -9,6 +9,14 @@ const hexTable = "0123456789ABCDEF"
type BytesResult []byte
func FromString(s string) BytesResult {
return (BytesResult)([]byte(s))
}
func FromBytes(b []byte) BytesResult {
return BytesResult(b)
}
// FromHexString 从十六进制获取
func FromHexString(s string) (BytesResult, error) {
b, err := hex.DecodeString(s)