From 1c5685d68f1b73270fb814fe04cbb490eb90ba5f Mon Sep 17 00:00:00 2001 From: mensonge Date: Fri, 14 Nov 2008 15:39:19 +0000 Subject: 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 --- includes/js/dojox/encoding/digests/MD5.js | 177 ------------------------------ 1 file changed, 177 deletions(-) delete mode 100644 includes/js/dojox/encoding/digests/MD5.js (limited to 'includes/js/dojox/encoding/digests/MD5.js') diff --git a/includes/js/dojox/encoding/digests/MD5.js b/includes/js/dojox/encoding/digests/MD5.js deleted file mode 100644 index eb72d59..0000000 --- a/includes/js/dojox/encoding/digests/MD5.js +++ /dev/null @@ -1,177 +0,0 @@ -if(!dojo._hasResource["dojox.encoding.digests.MD5"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code. -dojo._hasResource["dojox.encoding.digests.MD5"] = true; -dojo.provide("dojox.encoding.digests.MD5"); - -dojo.require("dojox.encoding.digests._base"); - -/* A port of Paul Johnstone's MD5 implementation - * http://pajhome.org.uk/crypt/md5/index.html - * - * Copyright (C) Paul Johnston 1999 - 2002. - * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet - * Distributed under the BSD License - * - * Dojo port by Tom Trenka - */ -(function(){ - var dxd=dojox.encoding.digests; - var chrsz=8; - - // MD5 rounds functions - function R(n,c){ return (n<>>(32-c)); } - function C(q,a,b,x,s,t){ return dxd.addWords(R(dxd.addWords(dxd.addWords(a, q), dxd.addWords(x, t)), s), b); } - function FF(a,b,c,d,x,s,t){ return C((b&c)|((~b)&d),a,b,x,s,t); } - function GG(a,b,c,d,x,s,t){ return C((b&d)|(c&(~d)),a,b,x,s,t); } - function HH(a,b,c,d,x,s,t){ return C(b^c^d,a,b,x,s,t); } - function II(a,b,c,d,x,s,t){ return C(c^(b|(~d)),a,b,x,s,t); } - - // the core MD5 rounds method - function core(x,len){ - x[len>>5]|=0x80<<((len)%32); - x[(((len+64)>>>9)<<4)+14]=len; - var a= 1732584193; - var b=-271733879; - var c=-1732584194; - var d= 271733878; - for(var i=0; i16){ - wa=core(wa, key.length*chrsz); - } - var l=[], r=[]; - for(var i=0; i<16; i++){ - l[i]=wa[i]^0x36363636; - r[i]=wa[i]^0x5c5c5c5c; - } - var h=core(l.concat(dxd.stringToWord(data)), 512+data.length*chrsz); - return core(r.concat(h), 640); - } - - // public function - dxd.MD5=function(/* string */data, /* dojox.encoding.digests.outputTypes? */outputType){ - // summary - // computes the digest of data, and returns the result according to type outputType - var out=outputType || dxd.outputTypes.Base64; - var wa=core(dxd.stringToWord(data), data.length*chrsz); - switch(out){ - case dxd.outputTypes.Raw:{ - return wa; // word[] - } - case dxd.outputTypes.Hex:{ - return dxd.wordToHex(wa); // string - } - case dxd.outputTypes.String:{ - return dxd.wordToString(wa); // string - } - default:{ - return dxd.wordToBase64(wa); // string - } - } - }; - - // make this private, for later use with a generic HMAC calculator. - dxd.MD5._hmac=function(/* string */data, /* string */key, /* dojox.encoding.digests.outputTypes? */outputType){ - // summary - // computes the digest of data, and returns the result according to type outputType - var out=outputType || dxd.outputTypes.Base64; - var wa=hmac(data, key); - switch(out){ - case dxd.outputTypes.Raw:{ - return wa; // word[] - } - case dxd.outputTypes.Hex:{ - return dxd.wordToHex(wa); // string - } - case dxd.outputTypes.String:{ - return dxd.wordToString(wa); // string - } - default:{ - return dxd.wordToBase64(wa); // string - } - } - }; -})(); - -} -- cgit v1.2.3