mirror of
https://github.com/emn178/js-sha256.git
synced 2026-08-13 04:46:10 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf975dfa0c |
@@ -1,5 +1,9 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
## v0.7.1 / 2017-10-31
|
||||||
|
### Improved
|
||||||
|
- performance of hBytes increment.
|
||||||
|
|
||||||
## v0.7.0 / 2017-10-31
|
## v0.7.0 / 2017-10-31
|
||||||
### Fixed
|
### Fixed
|
||||||
- incorrect result when file size >= 512M.
|
- incorrect result when file size >= 512M.
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "js-sha256",
|
"name": "js-sha256",
|
||||||
"version": "0.7.0",
|
"version": "0.7.1",
|
||||||
"main": ["src/sha256.js"],
|
"main": ["src/sha256.js"],
|
||||||
"ignore": [
|
"ignore": [
|
||||||
"samples",
|
"samples",
|
||||||
|
|||||||
Vendored
+2
-2
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "js-sha256",
|
"name": "js-sha256",
|
||||||
"version": "0.7.0",
|
"version": "0.7.1",
|
||||||
"description": "A simple SHA-256 / SHA-224 hash function for JavaScript supports UTF-8 encoding.",
|
"description": "A simple SHA-256 / SHA-224 hash function for JavaScript supports UTF-8 encoding.",
|
||||||
"main": "src/sha256.js",
|
"main": "src/sha256.js",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
+5
-5
@@ -1,7 +1,7 @@
|
|||||||
/**
|
/**
|
||||||
* [js-sha256]{@link https://github.com/emn178/js-sha256}
|
* [js-sha256]{@link https://github.com/emn178/js-sha256}
|
||||||
*
|
*
|
||||||
* @version 0.7.0
|
* @version 0.7.1
|
||||||
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
||||||
* @copyright Chen, Yi-Cyuan 2014-2017
|
* @copyright Chen, Yi-Cyuan 2014-2017
|
||||||
* @license MIT
|
* @license MIT
|
||||||
@@ -208,10 +208,6 @@
|
|||||||
|
|
||||||
this.lastByteIndex = i;
|
this.lastByteIndex = i;
|
||||||
this.bytes += i - this.start;
|
this.bytes += i - this.start;
|
||||||
while (this.bytes > 4294967295) {
|
|
||||||
++this.hBytes;
|
|
||||||
this.bytes -= 4294967296;
|
|
||||||
}
|
|
||||||
if (i >= 64) {
|
if (i >= 64) {
|
||||||
this.block = blocks[16];
|
this.block = blocks[16];
|
||||||
this.start = i - 64;
|
this.start = i - 64;
|
||||||
@@ -221,6 +217,10 @@
|
|||||||
this.start = i;
|
this.start = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (this.bytes > 4294967295) {
|
||||||
|
this.hBytes += this.bytes / 4294967296 << 0;
|
||||||
|
this.bytes = this.bytes % 4294967296;
|
||||||
|
}
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user