summaryrefslogtreecommitdiff
path: root/includes/js/dojox/encoding/base64.js
diff options
context:
space:
mode:
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-14 15:39:19 +0000
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-14 15:39:19 +0000
commit1c5685d68f1b73270fb814fe04cbb490eb90ba5f (patch)
tree3d3ada08a934b96fc31531f1327690d7edc6f766 /includes/js/dojox/encoding/base64.js
parent104d59099e048688c4dbac37d72137006e396558 (diff)
downloadsemanticscuttle-1c5685d68f1b73270fb814fe04cbb490eb90ba5f.tar.gz
semanticscuttle-1c5685d68f1b73270fb814fe04cbb490eb90ba5f.tar.bz2
Minor fix: Remove DOJO library (60Mo) replaced by link to Google CDN (online DOJO library)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@159 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'includes/js/dojox/encoding/base64.js')
-rw-r--r--includes/js/dojox/encoding/base64.js66
1 files changed, 0 insertions, 66 deletions
diff --git a/includes/js/dojox/encoding/base64.js b/includes/js/dojox/encoding/base64.js
deleted file mode 100644
index 916e119..0000000
--- a/includes/js/dojox/encoding/base64.js
+++ /dev/null
@@ -1,66 +0,0 @@
-if(!dojo._hasResource["dojox.encoding.base64"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
-dojo._hasResource["dojox.encoding.base64"] = true;
-dojo.provide("dojox.encoding.base64");
-
-(function(){
- var p="=";
- var tab="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
- var dxe=dojox.encoding;
-
- dxe.base64.encode=function(/* byte[] */ba){
- // summary
- // Encode an array of bytes as a base64-encoded string
- var s=[], l=ba.length;
- var rm=l%3;
- var x=l-rm;
- for (var i=0; i<x;){
- var t=ba[i++]<<16|ba[i++]<<8|ba[i++];
- s.push(tab.charAt((t>>>18)&0x3f));
- s.push(tab.charAt((t>>>12)&0x3f));
- s.push(tab.charAt((t>>>6)&0x3f));
- s.push(tab.charAt(t&0x3f));
- }
- // deal with trailers, based on patch from Peter Wood.
- switch(rm){
- case 2:{
- var t=ba[i++]<<16|ba[i++]<<8;
- s.push(tab.charAt((t>>>18)&0x3f));
- s.push(tab.charAt((t>>>12)&0x3f));
- s.push(tab.charAt((t>>>6)&0x3f));
- s.push(p);
- break;
- }
- case 1:{
- var t=ba[i++]<<16;
- s.push(tab.charAt((t>>>18)&0x3f));
- s.push(tab.charAt((t>>>12)&0x3f));
- s.push(p);
- s.push(p);
- break;
- }
- }
- return s.join(""); // string
- };
-
- dxe.base64.decode=function(/* string */str){
- // summary
- // Convert a base64-encoded string to an array of bytes
- var s=str.split(""), out=[];
- var l=s.length;
- while(s[--l]==p){ } // strip off trailing padding
- for (var i=0; i<l;){
- var t=tab.indexOf(s[i++])<<18;
- if(i<=l){ t|=tab.indexOf(s[i++])<<12 };
- if(i<=l){ t|=tab.indexOf(s[i++])<<6 };
- if(i<=l){ t|=tab.indexOf(s[i++]) };
- out.push((t>>>16)&0xff);
- out.push((t>>>8)&0xff);
- out.push(t&0xff);
- }
- // strip off any null bytes
- while(out[out.length-1]==0){ out.pop(); }
- return out; // byte[]
- };
-})();
-
-}