From 1ed546da31e824d69fb6e486b3c3109c43d24d99 Mon Sep 17 00:00:00 2001 From: rsiddharth Date: Sat, 14 Nov 2020 12:52:02 -0500 Subject: lib: add BytesToHexStr --- lib/hex.go | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/hex.go') 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 +} -- cgit v1.2.3