summaryrefslogtreecommitdiffstats
path: root/enc/b64.go
diff options
context:
space:
mode:
authorrsiddharth <s@ricketyspace.net>2020-08-29 00:34:43 -0400
committerrsiddharth <s@ricketyspace.net>2020-08-29 00:34:43 -0400
commitd10e28b9dcc4e794afa96e6aa5625be157d0ee15 (patch)
tree2841d8a19ff22a4964427b38152157571ec37c0b /enc/b64.go
parent50857ce4bcdd99855b239c09a7d2995868f49bbb (diff)
enc: update HexToBase64
Ensure lines are < 80 columns
Diffstat (limited to 'enc/b64.go')
-rw-r--r--enc/b64.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/enc/b64.go b/enc/b64.go
index ee5a8b6..1e49b58 100644
--- a/enc/b64.go
+++ b/enc/b64.go
@@ -10,7 +10,9 @@ func HexToBase64(hex string) string {
b64 := ""
for i := 0; i <= len(hb)-3; i = i + 3 {
- a := fromHexChar(hb[i])<<8 | fromHexChar(hb[i+1])<<4 | fromHexChar(hb[i+2])
+ a := (fromHexChar(hb[i])<<8 |
+ fromHexChar(hb[i+1])<<4 |
+ fromHexChar(hb[i+2]))
b64 += encode(a >> 6)
b64 += encode(a & 0b111111)
}