summaryrefslogtreecommitdiffstats
path: root/lib/b64.go
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2020-08-30 21:35:12 -0400
committerrsiddharth <s@ricketyspace.net>2020-08-30 21:35:12 -0400
commitc30ebd7eead4df6ef505b71d944eed315325e16f (patch)
treea1d530d60cb1681f42c17a60b7219d1043019f9d /lib/b64.go
parentc1240b472934f0b7649922722fe0d61c0c1c6cac (diff)
lib: update HexToBase64
* lib/b64.go (HexToBase64): Use hex instead of base 2 for the second AND to get the last 6 bits.
Diffstat (limited to 'lib/b64.go')
-rw-r--r--lib/b64.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/b64.go b/lib/b64.go
index d37f710..6b98d42 100644
--- a/lib/b64.go
+++ b/lib/b64.go
@@ -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
}