Improved performance of hBytes increment.

This commit is contained in:
Yi-Cyuan Chen
2017-10-31 20:30:01 +08:00
parent cb8eb73ef1
commit 5f0bd5a888
10 changed files with 24 additions and 20 deletions
+6 -6
View File
@@ -30,7 +30,7 @@
* [js-md5]{@link https://github.com/emn178/js-md5}
*
* @namespace md5
* @version 0.7.1
* @version 0.7.2
* @author Chen, Yi-Cyuan [emn178@gmail.com]
* @copyright Chen, Yi-Cyuan 2014-2017
* @license MIT
@@ -330,10 +330,6 @@
}
this.lastByteIndex = i;
this.bytes += i - this.start;
while (this.bytes > 4294967295) {
++this.hBytes;
this.bytes -= 4294967296;
}
if (i >= 64) {
this.start = i - 64;
this.hash();
@@ -342,6 +338,10 @@
this.start = i;
}
}
if (this.bytes > 4294967295) {
this.hBytes += this.bytes / 4294967296 << 0;
this.bytes = this.bytes % 4294967296;
}
return this;
};
@@ -725,7 +725,7 @@
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Sun Oct 29 2017 21:21:25 GMT+0800 (CST)
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)
</footer>
<script> prettyPrint(); </script>