mirror of
https://github.com/emn178/js-sha1.git
synced 2026-08-12 20:11:36 +08:00
Fixed
- incorrect result when first bit is 1 of bytes. Changed - prevent webpack to require dependencies.
This commit is contained in:
+2
-2
@@ -1,3 +1,3 @@
|
|||||||
/node_modules/
|
/node_modules/
|
||||||
/covreporter/
|
/coverage/
|
||||||
/my_test/
|
/.nyc_output/
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
/node_modules/
|
||||||
|
/coverage/
|
||||||
|
/.nyc_output/
|
||||||
|
/tests/
|
||||||
|
.covignore
|
||||||
|
.travis.yml
|
||||||
|
.npmignore
|
||||||
|
bower.json
|
||||||
+1
-2
@@ -4,8 +4,7 @@ node_js:
|
|||||||
- "8.6.0"
|
- "8.6.0"
|
||||||
before_install:
|
before_install:
|
||||||
- npm install coveralls
|
- npm install coveralls
|
||||||
- npm install mocha-lcov-reporter
|
after_success: npm run coveralls
|
||||||
script: npm run-script coveralls
|
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
## v0.6.0 / 2017-12-21
|
||||||
|
### Fixed
|
||||||
|
- incorrect result when first bit is 1 of bytes.
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- prevent webpack to require dependencies.
|
||||||
|
|
||||||
## v0.5.0 / 2017-10-31
|
## v0.5.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-sha1",
|
"name": "js-sha1",
|
||||||
"version": "0.5.0",
|
"version": "0.6.0",
|
||||||
"main": ["src/sha1.js"],
|
"main": ["src/sha1.js"],
|
||||||
"ignore": [
|
"ignore": [
|
||||||
"samples",
|
"samples",
|
||||||
|
|||||||
Vendored
+2
-2
File diff suppressed because one or more lines are too long
Generated
+1611
-113
File diff suppressed because it is too large
Load Diff
+12
-7
@@ -1,20 +1,20 @@
|
|||||||
{
|
{
|
||||||
"name": "js-sha1",
|
"name": "js-sha1",
|
||||||
"version": "0.5.0",
|
"version": "0.6.0",
|
||||||
"description": "A simple SHA1 hash function for JavaScript supports UTF-8 encoding.",
|
"description": "A simple SHA1 hash function for JavaScript supports UTF-8 encoding.",
|
||||||
"main": "src/sha1.js",
|
"main": "src/sha1.js",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"expect.js": "~0.3.1",
|
"expect.js": "~0.3.1",
|
||||||
"jscoverage": "~0.5.9",
|
|
||||||
"mocha": "~2.3.4",
|
"mocha": "~2.3.4",
|
||||||
|
"nyc": "^11.3.0",
|
||||||
"requirejs": "^2.1.22",
|
"requirejs": "^2.1.22",
|
||||||
"uglifyjs": "~2.4.10"
|
"uglify-js": "^3.1.9"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "mocha tests/node-test.js -r jscoverage",
|
"test": "nyc mocha tests/node-test.js",
|
||||||
"report": "mocha tests/node-test.js -r jscoverage --covout=html",
|
"report": "nyc --reporter=html --reporter=text mocha tests/node-test.js",
|
||||||
"coveralls": "mocha tests/node-test.js -R mocha-lcov-reporter -r jscoverage | coveralls",
|
"coveralls": "nyc report --reporter=text-lcov | coveralls",
|
||||||
"build": "uglifyjs src/sha1.js --compress --mangle --comments --output build/sha1.min.js"
|
"build": "uglifyjs src/sha1.js -c -m eval --comments -o build/sha1.min.js"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -32,5 +32,10 @@
|
|||||||
"homepage": "https://github.com/emn178/js-sha1",
|
"homepage": "https://github.com/emn178/js-sha1",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/emn178/js-sha1/issues"
|
"url": "https://github.com/emn178/js-sha1/issues"
|
||||||
|
},
|
||||||
|
"nyc": {
|
||||||
|
"exclude": [
|
||||||
|
"tests"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+4
-4
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* [js-sha1]{@link https://github.com/emn178/js-sha1}
|
* [js-sha1]{@link https://github.com/emn178/js-sha1}
|
||||||
*
|
*
|
||||||
* @version 0.5.0
|
* @version 0.6.0
|
||||||
* @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
|
||||||
@@ -49,8 +49,8 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
var nodeWrap = function (method) {
|
var nodeWrap = function (method) {
|
||||||
var crypto = require('crypto');
|
var crypto = eval("require('crypto')");
|
||||||
var Buffer = require('buffer').Buffer;
|
var Buffer = eval("require('buffer').Buffer");
|
||||||
var nodeMethod = function (message) {
|
var nodeMethod = function (message) {
|
||||||
if (typeof message === 'string') {
|
if (typeof message === 'string') {
|
||||||
return crypto.createHash('sha1').update(message, 'utf8').digest('hex');
|
return crypto.createHash('sha1').update(message, 'utf8').digest('hex');
|
||||||
@@ -169,7 +169,7 @@
|
|||||||
blocks[8] = blocks[9] = blocks[10] = blocks[11] =
|
blocks[8] = blocks[9] = blocks[10] = blocks[11] =
|
||||||
blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
|
blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;
|
||||||
}
|
}
|
||||||
blocks[14] = this.hBytes << 3 | this.bytes >> 29;
|
blocks[14] = this.hBytes << 3 | this.bytes >>> 29;
|
||||||
blocks[15] = this.bytes << 3;
|
blocks[15] = this.bytes << 3;
|
||||||
this.hash();
|
this.hash();
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user