summaryrefslogtreecommitdiffstats
path: root/lib/b64.go
diff options
context:
space:
mode:
Diffstat (limited to 'lib/b64.go')
-rw-r--r--lib/b64.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/b64.go b/lib/b64.go
index bdf26c0..1fb45dd 100644
--- a/lib/b64.go
+++ b/lib/b64.go
@@ -23,6 +23,16 @@ func encode(b uint16) string {
return string(b64_table[b])
}
+// Return the index for a base64 character.
+func index(c byte) uint32 {
+ for i := 0; i < 64; i++ {
+ if c == b64_table[i] {
+ return uint32(i)
+ }
+ }
+ return uint32(0)
+}
+
// Strip space and newline characters from string.
func stripSpaceChars(s string) string {
ss := ""