forked from koii-network/deterministic-rsa-js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
25 lines (20 loc) · 798 Bytes
/
test.js
File metadata and controls
25 lines (20 loc) · 798 Bytes
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
"use strict";
const bip39 = require("bip39");
const detRsa = require("./index");
main().then(console.log);
async function main() {
const mnemonic = "violin artwork lonely inject resource jewel purity village abstract neglect panda license"
const seed = await bip39.mnemonicToSeed(mnemonic);
return await detRsa.rsaGenKeys(4096, seed);
/* // Takes ~5 seconds on average, can probably be improved to 3
const iters = 100;
const start = (new Date()).getTime();
for (let i = 0; i < iters; ++i) {
const mnemonic = bip39.generateMnemonic();
const seed = await bip39.mnemonicToSeed(mnemonic);
const res = await detRsa.rsaGenKeys(4096, seed);
console.log(res);
}
console.log("Took", ((new Date()).getTime() - start) / (iters * 1000), "seconds on average");
*/
}