Comparing version 0.1.1 to 0.1.2
(function(r,w){var t={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,b:11,c:12,d:13,e:14,f:15,A:10,B:11,C:12,D:13,E:14,F:15},u=[7,12,17,22,7,12,17,22,7,12,17,22,7,12,17,22,5,9,14,20,5,9,14,20,5,9,14,20,5,9,14,20,4,11,16,23,4,11,16,23,4,11,16,23,4,11,16,23,6,10,15,21,6,10,15,21,6,10,15,21,6,10,15,21],v=[3614090360,3905402710,606105819,3250441966,4118548399,1200080426,2821735955,4249261313,1770035416,2336552879,4294925233,2304563134,1804603682,4254626195,2792965006,1236535329,4129170786,3225465664,643717713, | ||
3921069994,3593408605,38016083,3634488961,3889429448,568446438,3275163606,4107603335,1163531501,2850285829,4243563512,1735328473,2368359562,4294588738,2272392833,1839030562,4259657740,2763975236,1272893353,4139469664,3200236656,681279174,3936430074,3572445317,76029189,3654602809,3873151461,530742520,3299628645,4096336452,1126891415,2878612391,4237533241,1700485571,2399980690,4293915773,2240044497,1873313359,4264355552,2734768916,1309151649,4149444226,3174756917,718787259,3951481745],q=function(e){var a; | ||
a:{for(a=e.length;a--;)if(255<e.charCodeAt(a)){a=!0;break a}a=!1}if(a){var b=encodeURIComponent(e);e=[];var c=0;a=0;for(var d=b.length;c<d;++c){var m=b.charCodeAt(c);e[a>>2]=37==m?e[a>>2]|(t[b.charAt(++c)]<<4|t[b.charAt(++c)])<<(a%4<<3):e[a>>2]|m<<(a%4<<3);++a}b=(a+8>>6)+1<<4;c=a>>2;e[c]|=128<<(a%4<<3);for(c+=1;c<b;++c)e[c]=0;e[b-2]=a<<3}else{a=e.length;c=(a+8>>6)+1<<4;b=[];for(d=0;d<c;++d)b[d]=0;for(d=0;d<a;++d)b[d>>2]|=e.charCodeAt(d)<<(d%4<<3);b[d>>2]|=128<<(d%4<<3);b[c-2]=a<<3;e=b}a=1732584193; | ||
a:{for(a=e.length;a--;)if(127<e.charCodeAt(a)){a=!0;break a}a=!1}if(a){var b=encodeURIComponent(e);e=[];var c=0;a=0;for(var d=b.length;c<d;++c){var m=b.charCodeAt(c);e[a>>2]=37==m?e[a>>2]|(t[b.charAt(++c)]<<4|t[b.charAt(++c)])<<(a%4<<3):e[a>>2]|m<<(a%4<<3);++a}b=(a+8>>6)+1<<4;c=a>>2;e[c]|=128<<(a%4<<3);for(c+=1;c<b;++c)e[c]=0;e[b-2]=a<<3}else{a=e.length;c=(a+8>>6)+1<<4;b=[];for(d=0;d<c;++d)b[d]=0;for(d=0;d<a;++d)b[d>>2]|=e.charCodeAt(d)<<(d%4<<3);b[d>>2]|=128<<(d%4<<3);b[c-2]=a<<3;e=b}a=1732584193; | ||
for(var c=4023233417,b=2562383102,d=271733878,m=0,r=e.length;m<r;m+=16){for(var n=a,g=c,h=b,k=d,l,p,q,f=0;64>f;++f)16>f?(l=k^g&(h^k),p=f):32>f?(l=h^k&(g^h),p=(5*f+1)%16):48>f?(l=g^h^k,p=(3*f+5)%16):(l=h^(g|~k),p=7*f%16),q=k,k=h,h=g,n=n+l+v[f]+e[m+p],l=u[f],g+=n<<l|n>>>32-l,n=q;a=a+n|0;c=c+g|0;b=b+h|0;d=d+k|0}return s(a)+s(c)+s(b)+s(d)},s=function(e){for(var a="",b=0;4>b;b++)var c=b<<3,a=a+("0123456789abcdef".charAt(e>>c+4&15)+"0123456789abcdef".charAt(e>>c&15));return a};"undefined"!=typeof module? | ||
module.exports=q:r&&(r.md5=q)})(this); |
@@ -0,1 +1,5 @@ | ||
# v0.1.2 / 2014-07-27 | ||
Fixed accents bug | ||
# v0.1.1 / 2014-01-05 | ||
@@ -2,0 +6,0 @@ |
{ | ||
"name": "js-md5", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "A simple MD5 hash function for JavaScript supports UTF-8 encoding.", | ||
@@ -5,0 +5,0 @@ "main": "src/md5.js", |
# js-md5 | ||
This is a simple MD5 hash function for JavaScript supports UTF-8 encoding. | ||
A simple MD5 hash function for JavaScript supports UTF-8 encoding. | ||
@@ -4,0 +4,0 @@ ## Install |
/* | ||
* js-md5 v0.1.1 | ||
* js-md5 v0.1.2 | ||
* https://github.com/emn178/js-md5 | ||
@@ -114,3 +114,3 @@ * | ||
while(i--) | ||
if(message.charCodeAt(i) > 255) | ||
if(message.charCodeAt(i) > 127) | ||
return true; | ||
@@ -117,0 +117,0 @@ return false; |
assert('md5 1', 'd41d8cd98f00b204e9800998ecf8427e', md5('')); | ||
assert('md5 2', '9e107d9d372bb6826bd81d3542a419d6', md5('The quick brown fox jumps over the lazy dog')); | ||
assert('md5 3', 'e4d909c290d0fb1ca068ffaddf22cbd0', md5('The quick brown fox jumps over the lazy dog.')); | ||
assert('md5 4', 'a7bac2239fcdcb3a067903d8077c4a07', md5('中文')); | ||
assert('md5 5', 'ec3edbf3b05a449fc206a0138c739c3b', md5('aécio')); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11250
176