-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbench.js
65 lines (60 loc) · 1.67 KB
/
bench.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
'use strict';
const execa = require('execa');
const pbkdf2 = require('.');
async function bench(hpass, vpass, iterations) {
const hash = await pbkdf2.hash(hpass, {iterations});
return execa(
'sympact',
['--interval=25', `await require(".").verify("${hash}","${vpass}")`],
{
env: {FORCE_COLOR: true},
windowsVerbatimArguments: true
}
);
}
Promise.resolve()
// Default configs
.then(() => bench('r9(yaV@L', 'r9(yaV@L'))
.then(results => {
console.log('► CMD:', results.cmd);
console.log(results.stdout);
})
// Custom Iterations
.then(() => bench('r9(yaV@L', 'r9(yaV@L', 1000))
.then(results => {
console.log('► CMD:', results.cmd);
console.log(results.stdout);
})
.then(() => bench('r9(yaV@L', 'r9(yaV@L', 10000))
.then(results => {
console.log('► CMD:', results.cmd);
console.log(results.stdout);
})
.then(() => bench('r9(yaV@L', 'r9(yaV@L', 25000))
.then(results => {
console.log('► CMD:', results.cmd);
console.log(results.stdout);
})
.then(() => bench('r9(yaV@L', 'r9(yaV@L', 50000))
.then(results => {
console.log('► CMD:', results.cmd);
console.log(results.stdout);
})
.then(() => bench('r9(yaV@L', 'r9(yaV@L', 100000))
.then(results => {
console.log('► CMD:', results.cmd);
console.log(results.stdout);
})
.then(() => bench('r9(yaV@L', 'r9(yaV@L', 250000))
.then(results => {
console.log('► CMD:', results.cmd);
console.log(results.stdout);
})
.then(() => bench('r9(yaV@L', 'r9(yaV@L', 500000))
.then(results => {
console.log('► CMD:', results.cmd);
console.log(results.stdout);
})
.catch(err => {
console.error(err);
});