Fixed incorrect result when first bit is 1 of bytes. #18

pull/22/head v0.7.3
Yi-Cyuan Chen 8 years ago
parent 5f0bd5a888
commit 0263ab835f

@ -1,2 +0,0 @@
/node_modules/
/tests/

@ -0,0 +1,9 @@
/node_modules/
/coverage/
/.nyc_output/
/tests/
/doc/
.covignore
.travis.yml
.npmignore
bower.json

@ -4,8 +4,7 @@ node_js:
- "8.6.0"
before_install:
- npm install coveralls
- npm install mocha-lcov-reporter
script: npm run-script coveralls
after_success: npm run coveralls
branches:
only:
- master

@ -1,5 +1,9 @@
# Change Log
## v0.7.3 / 2017-12-18
### Fixed
- incorrect result when first bit is 1 of bytes. #18
## v0.7.2 / 2017-10-31
### Improved
- performance of hBytes increment.

@ -1,6 +1,6 @@
{
"name": "js-md5",
"version": "0.7.2",
"version": "0.7.3",
"main": ["src/md5.js"],
"ignore": [
"tests"

4
build/md5.min.js vendored

File diff suppressed because one or more lines are too long

@ -1185,7 +1185,7 @@
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Oct 31 2017 20:29:31 GMT+0800 (CST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Dec 18 2017 18:48:59 GMT+0800 (CST)
</footer>
<script> prettyPrint(); </script>

@ -300,7 +300,7 @@ md5(new Uint8Array([])); // d41d8cd98f00b204e9800998ecf8427e</code></pre>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Oct 31 2017 20:29:31 GMT+0800 (CST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Dec 18 2017 18:48:59 GMT+0800 (CST)
</footer>
<script> prettyPrint(); </script>

@ -96,7 +96,7 @@ md5.base64(''); // 1B2M2Y8AsgTpgAmY7PhCfg==</code></pre><h2>License</h2><p>The p
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Oct 31 2017 20:29:31 GMT+0800 (CST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Dec 18 2017 18:48:59 GMT+0800 (CST)
</footer>
<script> prettyPrint(); </script>

@ -47,7 +47,7 @@
<dt class="tag-version">Version:</dt>
<dd class="tag-version"><ul class="dummy"><li>0.7.2</li></ul></dd>
<dd class="tag-version"><ul class="dummy"><li>0.7.3</li></ul></dd>
@ -1460,7 +1460,7 @@ hash.update('The quick brown fox jumps over the lazy dog');</code></pre>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Oct 31 2017 20:29:31 GMT+0800 (CST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Dec 18 2017 18:48:59 GMT+0800 (CST)
</footer>
<script> prettyPrint(); </script>

@ -30,7 +30,7 @@
* [js-md5]{@link https://github.com/emn178/js-md5}
*
* @namespace md5
* @version 0.7.2
* @version 0.7.3
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2014-2017
* @license MIT
@ -363,7 +363,7 @@
blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
}
blocks[14] = this.bytes &lt;&lt; 3;
blocks[15] = this.hBytes &lt;&lt; 3 | this.bytes >> 29;
blocks[15] = this.hBytes &lt;&lt; 3 | this.bytes >>> 29;
this.hash();
};
@ -725,7 +725,7 @@
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Tue Oct 31 2017 20:29:31 GMT+0800 (CST)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Mon Dec 18 2017 18:48:59 GMT+0800 (CST)
</footer>
<script> prettyPrint(); </script>

1940
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -1,23 +1,23 @@
{
"name": "js-md5",
"version": "0.7.2",
"version": "0.7.3",
"description": "A simple MD5 hash function for JavaScript supports UTF-8 encoding.",
"main": "src/md5.js",
"devDependencies": {
"expect.js": "~0.3.1",
"jscoverage": "~0.5.9",
"jsdoc": "^3.4.0",
"mocha": "~2.3.4",
"nyc": "^11.3.0",
"requirejs": "^2.1.22",
"uglify-js": "~2.4.10",
"uglify-js": "^3.1.9",
"webworker-threads": "^0.7.11"
},
"scripts": {
"test": "mocha tests/node-test.js -r jscoverage",
"report": "mocha tests/node-test.js -r jscoverage --covout=html",
"coveralls": "mocha tests/node-test.js -R mocha-lcov-reporter -r jscoverage | coveralls",
"test": "nyc mocha tests/node-test.js",
"report": "nyc --reporter=html --reporter=text mocha tests/node-test.js",
"coveralls": "nyc report --reporter=text-lcov | coveralls",
"doc": "rm -rf doc;jsdoc src README.md -d doc",
"compress": "uglifyjs src/md5.js --compress --mangle --comments --output build/md5.min.js",
"compress": "uglifyjs src/md5.js -c -m eval --comments --output build/md5.min.js",
"build": "npm run-script compress;npm run-script doc"
},
"repository": {
@ -36,5 +36,10 @@
"homepage": "https://github.com/emn178/js-md5",
"bugs": {
"url": "https://github.com/emn178/js-md5/issues"
},
"nyc": {
"exclude": [
"tests"
]
}
}

@ -2,7 +2,7 @@
* [js-md5]{@link https://github.com/emn178/js-md5}
*
* @namespace md5
* @version 0.7.2
* @version 0.7.3
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2014-2017
* @license MIT
@ -335,7 +335,7 @@
blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
}
blocks[14] = this.bytes << 3;
blocks[15] = this.hBytes << 3 | this.bytes >> 29;
blocks[15] = this.hBytes << 3 | this.bytes >>> 29;
this.hash();
};

Loading…
Cancel
Save