1
0
mirror of https://github.com/charlienet/go-mixed.git synced 2025-07-17 16:12:42 +08:00
Files
go-mixed/encode/encode.go
2023-08-25 15:31:00 +08:00

20 lines
301 B
Go

package encode
import "encoding/hex"
type BytesResult []byte
func FromString(s string) BytesResult {
return BytesResult([]byte(s))
}
func FromHexString(s string) BytesResult {
b, _ := hex.DecodeString(s)
return BytesResult(b)
}
func FromBytes(b []byte) BytesResult {
return BytesResult(b)
}