summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/hex.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/hex.go b/lib/hex.go
index 9ec762c..f07ba08 100644
--- a/lib/hex.go
+++ b/lib/hex.go
@@ -94,3 +94,15 @@ func BytesToHexStr(bs []byte) string {
}
return hs
}
+
+func PrettifyHexStr(hs string) string {
+ p_hs := ""
+ for i := 0; i < len(hs); i++ {
+ p_hs += string(hs[i])
+
+ if (i+1)%32 == 0 {
+ p_hs += "\n"
+ }
+ }
+ return p_hs
+}