From a7d76b48e235d02124e6d87f326bf6b3051b46cd Mon Sep 17 00:00:00 2001 From: ltebean Date: Wed, 2 Jul 2014 17:33:12 +0800 Subject: [PATCH 1/2] add cortex.json --- cortex.json | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 cortex.json diff --git a/cortex.json b/cortex.json new file mode 100644 index 0000000..a2600ab --- /dev/null +++ b/cortex.json @@ -0,0 +1,40 @@ +{ + "name": "blueimp-md5", + "version": "1.1.0", + "title": "JavaScript MD5", + "description": "JavaScript MD5 implementation.", + "keywords": [ + "javascript", + "md5" + ], + "homepage": "https://github.com/blueimp/JavaScript-MD5", + "author": { + "name": "Sebastian Tschan", + "url": "https://blueimp.net" + }, + "maintainers": [ + { + "name": "Sebastian Tschan", + "url": "https://blueimp.net" + } + ], + "contributors": [ + { + "name": "Paul Johnston", + "url": "http://pajhome.org.uk/crypt/md5" + } + ], + "repository": { + "type": "git", + "url": "git://github.com/blueimp/JavaScript-MD5.git" + }, + "bugs": "https://github.com/blueimp/JavaScript-MD5/issues", + "licenses": [ + { + "type": "MIT", + "url": "http://www.opensource.org/licenses/MIT" + } + ], + + "main": "js/md5.js" +} From b36de2914731aea1cacafe1a070296f410c00212 Mon Sep 17 00:00:00 2001 From: ltebean Date: Wed, 2 Jul 2014 17:36:24 +0800 Subject: [PATCH 2/2] add module.exports --- js/md5.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/js/md5.js b/js/md5.js index f92ba37..c05b970 100644 --- a/js/md5.js +++ b/js/md5.js @@ -264,7 +264,10 @@ return raw_hmac_md5(key, string); } - if (typeof define === 'function' && define.amd) { + if (typeof module != 'undefined' && module.exports){ + module.exports = md5; + } + else if (typeof define === 'function' && define.amd) { define(function () { return md5; });