aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgutmet <me.git@gutmet.org>2020-04-27 18:00:19 +0200
committergutmet <me.git@gutmet.org>2020-04-27 18:00:19 +0200
commit88c7d63adcb7b57610c6ecb1d57583b62e1ff070 (patch)
tree6b574b4fd445f4e58865aa3abb399d8a0bbcf74f
parent69114e6782644c5b62285273803250f8790ae199 (diff)
downloadlaymanshex-88c7d63adcb7b57610c6ecb1d57583b62e1ff070.tar.gz
allow prefix 0x in byte field set
-rw-r--r--laymanshex.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/laymanshex.go b/laymanshex.go
index a7f1a9b..ef4e284 100644
--- a/laymanshex.go
+++ b/laymanshex.go
@@ -173,6 +173,7 @@ func (part *filePart) setHandling() {
return hex.EncodeToString(buf)
}
writeTo := func(w io.Writer, bo binary.ByteOrder, s string) {
+ s = strings.TrimPrefix(s, "0x")
buf, err := hex.DecodeString(s)
optPanic("invalid string of hex values: "+s, err)
if int64(len(buf)) > bytes {