Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More node version for testing #4

Merged
merged 6 commits into from
Sep 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
language: node_js
node_js:
- '5.0'
- '4.8.4'
- '5.5.0'
- '5.12.0'
- '6.0.0'
- '8.6.0'
git:
depth: 3
15 changes: 9 additions & 6 deletions hmacSha1.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ try{
crypto = require('crypto');

sha1 = function(key,enc, format){
var hash = crypto.createHash('sha1'); // create instance of sha1
hash.update(key, enc); // feed data to it, specify encoding
format = format || 'hex'; // defaults to hex,
return hash.digest(format); // return result specified format
enc = enc || 'binary'; // Fix for node versions >=6.0.0, in which default encoding is
// changed to utf-8.
format = format || 'hex'; // Defaults to hex
var hash = crypto.createHash('sha1'); // Create instance of sha1
hash.update(key, enc); // Feed data to it, specify encoding
return hash.digest(format); // Return result specified format
}

}
Expand All @@ -28,9 +30,10 @@ catch(err){

var opad_key = ""; // outer padded key
var ipad_key = ""; // inner padded key
var kLen = (enc === 'latin-1' || enc === 'utf8') ? this.asciiOnly(key) : key.length; // enforce ascii in

var kLen = (enc === 'latin-1' || enc === 'utf8') ? this.asciiOnly(key) : key.length; // Enforce ascii in
// key, only if non ascii
// encoding specified.
// encoding specified.
var diff;
var hashedKeyLen;

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"test": "node ./test/test.js"
},
"engines": {"node": ">=0.1.92"},
"engines": {"node": "<6.0.0"},
"author": {
"name":"gits2501",
"email":"[email protected]",
Expand Down