GoCollections/encoding/hex/hex.go
2022-12-03 19:13:29 +08:00

16 lines
256 B
Go

package hex
import (
"encoding/hex"
"github.com/tursom/GoCollections/unsafe"
)
func EncodeToString[T any](arr []T) string {
return hex.EncodeToString(unsafe.AsBytes(arr))
}
func DecodeString(s string) ([]byte, error) {
return hex.DecodeString(s)
}