we don't need base64 decode

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@131 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Pavol Rusnak 2009-06-16 15:47:38 +00:00
parent e1aa6b44b6
commit 836149e61f
1 changed files with 1 additions and 32 deletions

View File

@ -820,38 +820,7 @@ var Utils = {
this._keyStr.charAt(enc3) + this._keyStr.charAt(enc4);
} while (i < input.length);
return output;
},
"decode64" : function(input) {
var output = "";
var chr1, chr2, chr3;
var enc1, enc2, enc3, enc4;
var i = 0;
// remove all characters that are not A-Z, a-z, 0-9, +, /, or =
input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
do {
enc1 = this._keyStr.indexOf(input.charAt(i++));
enc2 = this._keyStr.indexOf(input.charAt(i++));
enc3 = this._keyStr.indexOf(input.charAt(i++));
enc4 = this._keyStr.indexOf(input.charAt(i++));
chr1 = (enc1 << 2) | (enc2 >> 4);
chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
chr3 = ((enc3 & 3) << 6) | enc4;
output = output + String.fromCharCode(chr1);
if (enc3 != 64) {
output = output + String.fromCharCode(chr2);
}
if (enc4 != 64) {
output = output + String.fromCharCode(chr3);
}
} while (i < input.length);
return output;
}
}