summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/b64.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/b64.go b/lib/b64.go
index 6b98d42..bdf26c0 100644
--- a/lib/b64.go
+++ b/lib/b64.go
@@ -22,3 +22,18 @@ func HexToBase64(hex string) string {
func encode(b uint16) string {
return string(b64_table[b])
}
+
+// Strip space and newline characters from string.
+func stripSpaceChars(s string) string {
+ ss := ""
+ for i := 0; i < len(s); i++ {
+ if s[i] == ' ' {
+ continue
+ }
+ if s[i] == '\n' {
+ continue
+ }
+ ss += string(s[i])
+ }
+ return ss
+}