mirror of
https://github.com/number571/go-peer.git
synced 2026-09-12 19:50:00 +05:00
16 lines
244 B
Go
16 lines
244 B
Go
package encoding
|
|
|
|
import "encoding/hex"
|
|
|
|
func HexEncode(pData []byte) string {
|
|
return hex.EncodeToString(pData)
|
|
}
|
|
|
|
func HexDecode(pData string) []byte {
|
|
result, err := hex.DecodeString(pData)
|
|
if err != nil {
|
|
return nil
|
|
}
|
|
return result
|
|
}
|