diff options
author | rsiddharth <s@ricketyspace.net> | 2020-08-31 20:48:22 -0400 |
---|---|---|
committer | rsiddharth <s@ricketyspace.net> | 2020-08-31 20:48:22 -0400 |
commit | 433c64daf692da215587f31cda85ef2612a10464 (patch) | |
tree | f5b41d9092e6940efbbe842a33c373d65e6ba263 /lib | |
parent | 66a3a35972b6330da73462d14eedf07158f7f299 (diff) |
lib/hex.go: update ByteToHexStr
* lib/hex.go (ByteToHexStr): Move around.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/hex.go | 20 |
1 files changed, 10 insertions, 10 deletions
@@ -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 +} |