summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2020-11-14 12:52:02 -0500
committerrsiddharth <s@ricketyspace.net>2020-11-14 12:52:02 -0500
commit1ed546da31e824d69fb6e486b3c3109c43d24d99 (patch)
tree233e4b38c096707a4bf72cead7ed127ffea41492
parentcc009a20fa3eece08b3b80296784ab94fd974d2b (diff)
lib: add BytesToHexStr
-rw-r--r--lib/hex.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/hex.go b/lib/hex.go
index 98f3210..d680a28 100644
--- a/lib/hex.go
+++ b/lib/hex.go
@@ -66,3 +66,12 @@ func ByteToHexStr(b byte) string {
return s
}
+
+func BytesToHexStr(bs []byte) string {
+ hs := ""
+
+ for i := 0; i < len(bs); i++ {
+ hs += " " + ByteToHexStr(bs[i])
+ }
+ return hs
+}