github.com/tursom/GoCollections@v0.3.10/encoding/hex/hex.go (about) 1 package hex 2 3 import ( 4 "encoding/hex" 5 6 "github.com/tursom/GoCollections/unsafe" 7 ) 8 9 func EncodeToString[T any](arr []T) string { 10 return hex.EncodeToString(unsafe.AsBytes(arr)) 11 } 12 13 func DecodeString(s string) ([]byte, error) { 14 return hex.DecodeString(s) 15 }