base64.js
authorAlan Knowles <alan@akbkhome.com>
Fri, 30 Dec 2011 06:34:51 +0000 (14:34 +0800)
committerAlan Knowles <alan@akbkhome.com>
Fri, 30 Dec 2011 06:34:51 +0000 (14:34 +0800)
base64.js

index acb1b95..06ae40f 100644 (file)
--- a/base64.js
+++ b/base64.js
@@ -81,8 +81,10 @@ base64.getbyte64 = function(s,i) {
     }
     return idx;
 }
-
 base64.decode = function(s) {
+    return base64.decodeToArray(s).join('');
+}
+base64.decodeToArray = function(s) {
     // convert to string
     s = '' + s;
     var getbyte64 = base64.getbyte64;
@@ -123,7 +125,7 @@ base64.decode = function(s) {
         x.push(String.fromCharCode(b10 >> 16));
         break;
     }
-    return x.join('');
+    return x;
 }
 
 base64.getbyte = function(s,i) {