From 7a865c80b8fc6c16c149d1a9e93a0c1ad12ca8ad Mon Sep 17 00:00:00 2001 From: Norman Soetbeer Date: Mon, 7 Sep 2020 08:52:42 +0200 Subject: [PATCH] Use base64-encoding in favor of hex-encoding --- pkging/embed/embed.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkging/embed/embed.go b/pkging/embed/embed.go index 3ed7e7e..5358675 100644 --- a/pkging/embed/embed.go +++ b/pkging/embed/embed.go @@ -3,15 +3,15 @@ package embed import ( "bytes" "compress/gzip" - "encoding/hex" + "encoding/base64" "io" "github.com/markbates/pkger/here" ) func Decode(src []byte) ([]byte, error) { - dst := make([]byte, hex.DecodedLen(len(src))) - _, err := hex.Decode(dst, src) + dst := make([]byte, base64.RawStdEncoding.DecodedLen(len(src))) + _, err := base64.RawStdEncoding.Decode(dst, src) if err != nil { return nil, err } @@ -44,7 +44,7 @@ func Encode(b []byte) ([]byte, error) { return nil, err } - s := hex.EncodeToString(bb.Bytes()) + s := base64.RawStdEncoding.EncodeToString(bb.Bytes()) return []byte(s), nil }