diff options
author | rsiddharth <s@ricketyspace.net> | 2020-08-30 21:35:12 -0400 |
---|---|---|
committer | rsiddharth <s@ricketyspace.net> | 2020-08-30 21:35:12 -0400 |
commit | c30ebd7eead4df6ef505b71d944eed315325e16f (patch) | |
tree | a1d530d60cb1681f42c17a60b7219d1043019f9d | |
parent | c1240b472934f0b7649922722fe0d61c0c1c6cac (diff) |
lib: update HexToBase64
* lib/b64.go (HexToBase64): Use hex instead of base 2 for the second
AND to get the last 6 bits.
-rw-r--r-- | lib/b64.go | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -14,7 +14,7 @@ func HexToBase64(hex string) string { HexCharToDec(hb[i+1])<<4 | HexCharToDec(hb[i+2])) b64 += encode(a >> 6) - b64 += encode(a & 0b111111) + b64 += encode(a & 0x3f) } return b64 } |