From 7460e35a176a7fa0ef19da6f9a97b28f89b86745 Mon Sep 17 00:00:00 2001 From: Sebastian Tschan Date: Sun, 27 Dec 2015 14:28:51 +0100 Subject: [PATCH 01/71] Remove Grunt dependencies. Update dev dependencies. Remove obsolete file version numbers. --- .jshintignore | 1 + Gruntfile.js | 68 ------------------------------------------------- css/demo.css | 2 +- index.html | 6 ++--- js/demo.js | 2 +- js/md5.js | 4 +-- js/md5.min.js | 2 +- package.json | 36 ++++++++++++++++++++------ test/index.html | 6 ++--- test/test.js | 4 +-- 10 files changed, 42 insertions(+), 89 deletions(-) create mode 100644 .jshintignore delete mode 100644 Gruntfile.js diff --git a/.jshintignore b/.jshintignore new file mode 100644 index 0000000..5917cb8 --- /dev/null +++ b/.jshintignore @@ -0,0 +1 @@ +js/*.min.js diff --git a/Gruntfile.js b/Gruntfile.js deleted file mode 100644 index 541af13..0000000 --- a/Gruntfile.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * JavaScript MD5 Gruntfile - * https://github.com/blueimp/JavaScript-MD5 - * - * Copyright 2013, Sebastian Tschan - * https://blueimp.net - * - * Licensed under the MIT license: - * http://www.opensource.org/licenses/MIT - */ - -/*global module */ - -module.exports = function (grunt) { - 'use strict'; - - grunt.initConfig({ - jshint: { - all: [ - 'Gruntfile.js', - 'js/demo.js', - 'js/md5.js', - 'test/test.js' - ] - }, - simplemocha: { - options: { - ignoreLeaks: false, - ui: 'bdd', - reporter: 'spec' - }, - all: { - src: ['test/test.js'] - } - }, - mocha: { - all: { - src: ['test/index.html'], - options: { - run: true, - bail: true, - log: true, - reporter: 'Spec' - }, - mocha: { - ignoreLeaks: false - } - } - }, - uglify: { - production: { - src: [ - 'js/md5.js' - ], - dest: 'js/md5.min.js' - } - } - }); - - grunt.loadNpmTasks('grunt-contrib-jshint'); - grunt.loadNpmTasks('grunt-simple-mocha'); - grunt.loadNpmTasks('grunt-contrib-uglify'); - grunt.loadNpmTasks('grunt-bump-build-git'); - - grunt.registerTask('test', ['jshint', 'simplemocha']); - grunt.registerTask('default', ['test', 'uglify']); - -}; diff --git a/css/demo.css b/css/demo.css index 209bbbc..047174e 100644 --- a/css/demo.css +++ b/css/demo.css @@ -1,5 +1,5 @@ /* - * JavaScript MD5 Demo CSS 1.0.1 + * JavaScript MD5 Demo CSS * https://github.com/blueimp/JavaScript-MD5 * * Copyright 2013, Sebastian Tschan diff --git a/index.html b/index.html index 80b1893..7fbaf1f 100644 --- a/index.html +++ b/index.html @@ -1,7 +1,7 @@ - + - + diff --git a/js/demo.js b/js/demo.js index 03373ba..96565d3 100644 --- a/js/demo.js +++ b/js/demo.js @@ -1,5 +1,5 @@ /* - * JavaScript MD5 Demo JS 1.0.1 + * JavaScript MD5 Demo JS * https://github.com/blueimp/JavaScript-MD5 * * Copyright 2013, Sebastian Tschan diff --git a/js/md5.js b/js/md5.js index f92ba37..d61eaf3 100644 --- a/js/md5.js +++ b/js/md5.js @@ -1,5 +1,5 @@ /* - * JavaScript MD5 1.0.1 + * JavaScript MD5 * https://github.com/blueimp/JavaScript-MD5 * * Copyright 2011, Sebastian Tschan @@ -7,7 +7,7 @@ * * Licensed under the MIT license: * http://www.opensource.org/licenses/MIT - * + * * Based on * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message * Digest Algorithm, as defined in RFC 1321. diff --git a/js/md5.min.js b/js/md5.min.js index 11b1545..ce09ed2 100644 --- a/js/md5.min.js +++ b/js/md5.min.js @@ -1 +1 @@ -!function(a){"use strict";function b(a,b){var c=(65535&a)+(65535&b),d=(a>>16)+(b>>16)+(c>>16);return d<<16|65535&c}function c(a,b){return a<>>32-b}function d(a,d,e,f,g,h){return b(c(b(b(d,a),b(f,h)),g),e)}function e(a,b,c,e,f,g,h){return d(b&c|~b&e,a,b,f,g,h)}function f(a,b,c,e,f,g,h){return d(b&e|c&~e,a,b,f,g,h)}function g(a,b,c,e,f,g,h){return d(b^c^e,a,b,f,g,h)}function h(a,b,c,e,f,g,h){return d(c^(b|~e),a,b,f,g,h)}function i(a,c){a[c>>5]|=128<>>9<<4)+14]=c;var d,i,j,k,l,m=1732584193,n=-271733879,o=-1732584194,p=271733878;for(d=0;d>5]>>>b%32&255);return c}function k(a){var b,c=[];for(c[(a.length>>2)-1]=void 0,b=0;b>5]|=(255&a.charCodeAt(b/8))<16&&(e=i(e,8*a.length)),c=0;16>c;c+=1)f[c]=909522486^e[c],g[c]=1549556828^e[c];return d=i(f.concat(k(b)),512+8*b.length),j(i(g.concat(d),640))}function n(a){var b,c,d="0123456789abcdef",e="";for(c=0;c>>4&15)+d.charAt(15&b);return e}function o(a){return unescape(encodeURIComponent(a))}function p(a){return l(o(a))}function q(a){return n(p(a))}function r(a,b){return m(o(a),o(b))}function s(a,b){return n(r(a,b))}function t(a,b,c){return b?c?r(b,a):s(b,a):c?p(a):q(a)}"function"==typeof define&&define.amd?define(function(){return t}):a.md5=t}(this); \ No newline at end of file +!function(n){"use strict";function t(n,t){var r=(65535&n)+(65535&t),e=(n>>16)+(t>>16)+(r>>16);return e<<16|65535&r}function r(n,t){return n<>>32-t}function e(n,e,u,o,c,f){return t(r(t(t(e,n),t(o,f)),c),u)}function u(n,t,r,u,o,c,f){return e(t&r|~t&u,n,t,o,c,f)}function o(n,t,r,u,o,c,f){return e(t&u|r&~u,n,t,o,c,f)}function c(n,t,r,u,o,c,f){return e(t^r^u,n,t,o,c,f)}function f(n,t,r,u,o,c,f){return e(r^(t|~u),n,t,o,c,f)}function i(n,r){n[r>>5]|=128<>>9<<4)+14]=r;var e,i,a,h,d,g=1732584193,l=-271733879,v=-1732584194,C=271733878;for(e=0;e>5]>>>t%32&255);return r}function h(n){var t,r=[];for(r[(n.length>>2)-1]=void 0,t=0;t>5]|=(255&n.charCodeAt(t/8))<16&&(u=i(u,8*n.length)),r=0;16>r;r+=1)o[r]=909522486^u[r],c[r]=1549556828^u[r];return e=i(o.concat(h(t)),512+8*t.length),a(i(c.concat(e),640))}function l(n){var t,r,e="0123456789abcdef",u="";for(r=0;r>>4&15)+e.charAt(15&t);return u}function v(n){return unescape(encodeURIComponent(n))}function C(n){return d(v(n))}function m(n){return l(C(n))}function s(n,t){return g(v(n),v(t))}function A(n,t){return l(s(n,t))}function p(n,t,r){return t?r?s(t,n):A(t,n):r?C(n):m(n)}"function"==typeof define&&define.amd?define(function(){return p}):n.md5=p}(this); diff --git a/package.json b/package.json index a589dc3..aa50c82 100644 --- a/package.json +++ b/package.json @@ -31,15 +31,35 @@ "bugs": "https://github.com/blueimp/JavaScript-MD5/issues", "license": "MIT", "devDependencies": { - "grunt": "~0.4.1", - "grunt-contrib-uglify": "~0.2.7", - "grunt-contrib-jshint": "~0.7.1", - "grunt-bump-build-git": "~1.0.0", - "grunt-simple-mocha": "~0.4.0", - "expect.js": "0.2.0" + "expect.js": "0.3.1", + "jshint": "2.8.0", + "mocha": "2.3.4", + "uglify-js": "2.6.1" }, "scripts": { - "test": "grunt test" + "test": "jshint js test && mocha", + "build": "uglifyjs js/md5.js -c -m > js/md5.min.js", + "preversion": "npm test", + "version": "npm run build && git add -A js", + "postversion": "git push origin master --tags && npm publish" }, - "main": "js/md5.js" + "main": "js/md5.js", + "jshintConfig": { + "bitwise": true, + "curly": true, + "eqeqeq": true, + "forin": true, + "freeze": true, + "immed": true, + "latedef": true, + "newcap": true, + "noarg": true, + "noempty": true, + "nonbsp": true, + "nonew": true, + "quotmark": true, + "undef": true, + "unused": true, + "strict": true + } } diff --git a/test/index.html b/test/index.html index 2c06f4f..a8edd48 100644 --- a/test/index.html +++ b/test/index.html @@ -1,7 +1,7 @@ JavaScript MD5 Demo - +

JavaScript MD5 Demo

JavaScript MD5 implementation.
-Compatible with server-side environments like node.js, module loaders like RequireJS and all web browsers.

+Compatible with server-side environments like Node.js, module loaders like RequireJS, Browserify or webpack and all web browsers.