summaryrefslogtreecommitdiffstats
path: root/lib/hex.go
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2020-08-31 20:48:22 -0400
committerrsiddharth <s@ricketyspace.net>2020-08-31 20:48:22 -0400
commit433c64daf692da215587f31cda85ef2612a10464 (patch)
treef5b41d9092e6940efbbe842a33c373d65e6ba263 /lib/hex.go
parent66a3a35972b6330da73462d14eedf07158f7f299 (diff)
lib/hex.go: update ByteToHexStr
* lib/hex.go (ByteToHexStr): Move around.
Diffstat (limited to 'lib/hex.go')
-rw-r--r--lib/hex.go20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/hex.go b/lib/hex.go
index 0087f33..98f3210 100644
--- a/lib/hex.go
+++ b/lib/hex.go
@@ -44,16 +44,6 @@ func HexStrToAsciiStr(h string) string {
return a
}
-func ByteToHexStr(b byte) string {
- p := DecToHexChar(uint16(b >> 4))
- q := DecToHexChar(uint16(b & 0xf))
-
- s := string(p)
- s += string(q)
-
- return s
-}
-
func AsciiStrToHexStr(as string) string {
hs := ""
if len(as) < 1 {
@@ -66,3 +56,13 @@ func AsciiStrToHexStr(as string) string {
}
return hs
}
+
+func ByteToHexStr(b byte) string {
+ p := DecToHexChar(uint16(b >> 4))
+ q := DecToHexChar(uint16(b & 0xf))
+
+ s := string(p)
+ s += string(q)
+
+ return s
+}