diff options
author | siddharth <s@ricketyspace.net> | 2021-10-10 09:44:17 -0400 |
---|---|---|
committer | siddharth <s@ricketyspace.net> | 2021-10-10 09:44:17 -0400 |
commit | 4f69c676b0da0b156cd0bf6255f39e704a2931cf (patch) | |
tree | 678470f7ba7078c60d565587acbc4602f9caf9df | |
parent | 76817030d36bcf4e446e404ac8147c4a7ecd6617 (diff) |
lib: update HexStrToAsciiStr
Convert uint16 to byte before converting it to a string.
-rw-r--r-- | lib/hex.go | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -34,11 +34,11 @@ func HexStrToAsciiStr(h string) string { return a } if lh == 1 { - return string(HexCharToDec(h[0])) + return string(byte(HexCharToDec(h[0]))) } for i := 0; i < lh; i += 2 { - b := HexCharToDec(h[i])<<4 | HexCharToDec(h[i+1]) + b := byte(HexCharToDec(h[i])<<4 | HexCharToDec(h[i+1])) a += string(b) } return a |