You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
446 B
22 lines
446 B
5 years ago
|
|
||
|
var hasher = require("./")();
|
||
|
var assert = require("assert");
|
||
|
|
||
|
var opts = {
|
||
|
password: "helloworld"
|
||
|
};
|
||
|
|
||
|
hasher(opts, function(err, pass, salt, hash) {
|
||
|
opts.salt = salt;
|
||
|
hasher(opts, function(err, pass, salt, hash2) {
|
||
|
assert.deepEqual(hash2, hash);
|
||
|
|
||
|
// password mismatch
|
||
|
opts.password = "aaa";
|
||
|
hasher(opts, function(err, pass, salt, hash2) {
|
||
|
assert.notDeepEqual(hash2, hash);
|
||
|
console.log("OK");
|
||
|
});
|
||
|
});
|
||
|
});
|