diff options
author | rsiddharth <s@ricketyspace.net> | 2020-11-14 12:52:02 -0500 |
---|---|---|
committer | rsiddharth <s@ricketyspace.net> | 2020-11-14 12:52:02 -0500 |
commit | 1ed546da31e824d69fb6e486b3c3109c43d24d99 (patch) | |
tree | 233e4b38c096707a4bf72cead7ed127ffea41492 /lib | |
parent | cc009a20fa3eece08b3b80296784ab94fd974d2b (diff) |
lib: add BytesToHexStr
Diffstat (limited to 'lib')
-rw-r--r-- | lib/hex.go | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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 +} |