From 6873ee803969ee57dd5dfe7bb93591476b737fa8 Mon Sep 17 00:00:00 2001 From: "[1000i100] Millicent Billette" <git@1000i100.fr> Date: Fri, 2 Apr 2021 19:03:02 +0200 Subject: [PATCH] vanityLike.mjs more thread space --- CI/vanityLike.mjs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/CI/vanityLike.mjs b/CI/vanityLike.mjs index f3a1229..409a089 100644 --- a/CI/vanityLike.mjs +++ b/CI/vanityLike.mjs @@ -1,4 +1,4 @@ -import * as app from "../src/crypto.mjs"; +import * as duniCrypto from "../src/crypto.mjs"; // For thread use : https://github.com/darionco/WebCPU const fillChr=' '; @@ -11,17 +11,17 @@ function main() { let PARALLEL_INDEX = 0; if(process.argv[2]) PARALLEL_INDEX = parseInt(process.argv[2]); - const PARALLEL_THREAD = 4; + const PARALLEL_THREAD = 42; const startTime = Date.now(); // performance.now() let partialLevel = 0; for (let x = PARALLEL_INDEX; true; x+=PARALLEL_THREAD) { const strX = ('vanityDebugSeed' + x).replace(/0/g, 'z'); - const keys = app.raw2b58(app.seed2keyPair(app.b58pubKey2bin(strX))); + const keys = duniCrypto.raw2b58(duniCrypto.seed2keyPair(duniCrypto.b58pubKey2bin(strX))); let pubKey = keys.publicKey; if(pubKey[0]==='1'){ - pubKey = app.b58.encode(app.sliceInitialsZero(app.b58pubKey2bin(pubKey))); + pubKey = duniCrypto.b58.encode(duniCrypto.sliceInitialsZero(duniCrypto.b58pubKey2bin(pubKey))); const now = Date.now(); // performance.now() const elapsed = f(7,''+Math.trunc((now-startTime)/1000)); const speed = f(5,''+Math.trunc((x/PARALLEL_THREAD)/((now-startTime)/1000))); @@ -34,15 +34,15 @@ function main() { partialLevel=2; console.log(`${speed}/s écoulé: ${elapsed}s seed:${f(44,strX)} pubKey:${f(44,pubKey)}`); } - if(app.pubKey2checksum(pubKey)[0]==='1'){ + if(duniCrypto.pubKey2checksum(pubKey)[0]==='1'){ if(partialLevel<4){ partialLevel=3; - console.log(`${speed}/s écoulé: ${elapsed}s seed:${f(44,strX)} pubKey:${f(44,pubKey)} chk: ${app.pubKey2checksum(pubKey)} ${app.pubKey2checksum(pubKey, false, true)}`); + console.log(`${speed}/s écoulé: ${elapsed}s seed:${f(44,strX)} pubKey:${f(44,pubKey)} chk: ${duniCrypto.pubKey2checksum(pubKey)} ${duniCrypto.pubKey2checksum(pubKey, false, true)}`); } - if(app.pubKey2checksum(pubKey,true)[0]==='1'){ + if(duniCrypto.pubKey2checksum(pubKey,true)[0]==='1'){ console.log(`${speed}/s écoulé: ${elapsed}s seed:${f(44,strX)} pubKey:${f(44,pubKey) - } chk: ${app.pubKey2checksum(pubKey)} ${app.pubKey2checksum(pubKey, false, true) - } ${app.pubKey2checksum(pubKey,true)} ${app.pubKey2checksum(pubKey,true, true)}`); + } chk: ${duniCrypto.pubKey2checksum(pubKey)} ${duniCrypto.pubKey2checksum(pubKey, false, true) + } ${duniCrypto.pubKey2checksum(pubKey,true)} ${duniCrypto.pubKey2checksum(pubKey,true, true)}`); return; } } -- GitLab