aboutsummaryrefslogtreecommitdiff
path: root/node_modules/hash.js/test
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2017-08-14 05:01:11 +0200
committerFlorian Dold <florian.dold@gmail.com>2017-08-14 05:02:09 +0200
commit363723fc84f7b8477592e0105aeb331ec9a017af (patch)
tree29f92724f34131bac64d6a318dd7e30612e631c7 /node_modules/hash.js/test
parent5634e77ad96bfe1818f6b6ee70b7379652e5487f (diff)
node_modules
Diffstat (limited to 'node_modules/hash.js/test')
-rw-r--r--node_modules/hash.js/test/hash-test.js23
-rw-r--r--node_modules/hash.js/test/hmac-test.js13
2 files changed, 22 insertions, 14 deletions
diff --git a/node_modules/hash.js/test/hash-test.js b/node_modules/hash.js/test/hash-test.js
index 97347a27f..6a36efc6f 100644
--- a/node_modules/hash.js/test/hash-test.js
+++ b/node_modules/hash.js/test/hash-test.js
@@ -1,3 +1,6 @@
+'use strict';
+/* global describe it */
+
var assert = require('assert');
var hash = require('../');
@@ -12,9 +15,9 @@ describe('Hash', function() {
assert.equal(dgst, res);
// Split message
- var dgst = fn().update(msg.slice(0, 2), enc)
- .update(msg.slice(2), enc)
- .digest('hex');
+ dgst = fn().update(msg.slice(0, 2), enc)
+ .update(msg.slice(2), enc)
+ .digest('hex');
assert.equal(dgst, res);
}
}
@@ -92,10 +95,11 @@ describe('Hash', function() {
'ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a' +
'2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f'
],
- [ 'abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn' +
- 'hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu',
+ [
+ 'abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn' +
+ 'hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu',
'8e959b75dae313da8cf4f72814fc143f8f7779c6eb9f7fa17299aeadb6889018' +
- '501d289e4900f7e4331b99dec4b5433ac7d329eeb6dd26545e96e55b874be909'
+ '501d289e4900f7e4331b99dec4b5433ac7d329eeb6dd26545e96e55b874be909'
]
]);
});
@@ -109,10 +113,11 @@ describe('Hash', function() {
'cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed' +
'8086072ba1e7cc2358baeca134c825a7'
],
- [ 'abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn' +
- 'hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu',
+ [
+ 'abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmn' +
+ 'hijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu',
'09330c33f71147e83d192fc782cd1b4753111b173b3b05d22fa08086e3b0f712' +
- 'fcc7c71a557e2db966c3e9fa91746039'
+ 'fcc7c71a557e2db966c3e9fa91746039'
]
]);
});
diff --git a/node_modules/hash.js/test/hmac-test.js b/node_modules/hash.js/test/hmac-test.js
index 0a9647eec..6fe18e38e 100644
--- a/node_modules/hash.js/test/hmac-test.js
+++ b/node_modules/hash.js/test/hmac-test.js
@@ -1,6 +1,8 @@
+'use strict';
+/* global describe it */
+
var assert = require('assert');
var hash = require('../');
-var utils = hash.utils;
describe('Hmac', function() {
describe('mixed test vector', function() {
@@ -49,10 +51,11 @@ describe('Hmac', function() {
it('should not fail at ' + opt.name, function() {
var h = hash.hmac(hash.sha256, opt.key, 'hex');
assert.equal(h.update(opt.msg, opt.msgEnc).digest('hex'), opt.res);
- var h = hash.hmac(hash.sha256, opt.key, 'hex');
- assert.equal(h.update(opt.msg.slice(0, 10), opt.msgEnc)
- .update(opt.msg.slice(10), opt.msgEnc)
- .digest('hex'), opt.res);
+ h = hash.hmac(hash.sha256, opt.key, 'hex');
+ assert.equal(h
+ .update(opt.msg.slice(0, 10), opt.msgEnc)
+ .update(opt.msg.slice(10), opt.msgEnc)
+ .digest('hex'), opt.res);
});
}
});