mirror of
https://github.com/charlienet/go-mixed.git
synced 2025-07-18 00:22:41 +08:00
update
This commit is contained in:
19
encode/encode.go
Normal file
19
encode/encode.go
Normal file
@ -0,0 +1,19 @@
|
||||
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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user