-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
38 lines (30 loc) · 884 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
const scrypt = require('./scrypt');
const wrapResultForCallback = (err, verified) => {
console.log(err, verified);
}
const testHash = (algo, password, hashSettings) => {
switch(algo) {
case 'scrypt':
scrypt(password, hashSettings, wrapResultForCallback);
break;
}
}
const testHashSettings = {
"algorithm": "scrypt",
"hash": {
"value": "lugzEQYD8QEe+7nA+ldPiJoD+jATYhuVUnzbW0OQ4XasBKWvMBZbrydBExlf7j6fSpSTv46YhoOvc6HLH8Uvyg==",
"encoding": "base64"
},
"salt": {
"value":"CFAFE413A6384300ABE7FF288A33016Ab2cdd6f2ec4242d6a44236abe2e181ff",
"encoding": "ascii"
},
"password": {
"encoding": "utf16le"
},
"costfactor": 131072,
"blocksize": 8,
"parallelization": 1,
"keylength": 64
}
testHash('scrypt', 'TESThashFORauth0@2201', testHashSettings);