Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
G1lib.js
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libs
G1lib.js
Commits
6873ee80
Commit
6873ee80
authored
4 years ago
by
Millicent Billette
Browse files
Options
Downloads
Patches
Plain Diff
vanityLike.mjs more thread space
parent
bef67c11
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CI/vanityLike.mjs
+9
-9
9 additions, 9 deletions
CI/vanityLike.mjs
with
9 additions
and
9 deletions
CI/vanityLike.mjs
+
9
−
9
View file @
6873ee80
import
*
as
app
from
"
../src/crypto.mjs
"
;
import
*
as
duniCrypto
from
"
../src/crypto.mjs
"
;
// For thread use : https://github.com/darionco/WebCPU
// For thread use : https://github.com/darionco/WebCPU
const
fillChr
=
'
'
;
const
fillChr
=
'
'
;
...
@@ -11,17 +11,17 @@ function main() {
...
@@ -11,17 +11,17 @@ function main() {
let
PARALLEL_INDEX
=
0
;
let
PARALLEL_INDEX
=
0
;
if
(
process
.
argv
[
2
])
PARALLEL_INDEX
=
parseInt
(
process
.
argv
[
2
]);
if
(
process
.
argv
[
2
])
PARALLEL_INDEX
=
parseInt
(
process
.
argv
[
2
]);
const
PARALLEL_THREAD
=
4
;
const
PARALLEL_THREAD
=
4
2
;
const
startTime
=
Date
.
now
();
// performance.now()
const
startTime
=
Date
.
now
();
// performance.now()
let
partialLevel
=
0
;
let
partialLevel
=
0
;
for
(
let
x
=
PARALLEL_INDEX
;
true
;
x
+=
PARALLEL_THREAD
)
{
for
(
let
x
=
PARALLEL_INDEX
;
true
;
x
+=
PARALLEL_THREAD
)
{
const
strX
=
(
'
vanityDebugSeed
'
+
x
).
replace
(
/0/g
,
'
z
'
);
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
;
let
pubKey
=
keys
.
publicKey
;
if
(
pubKey
[
0
]
===
'
1
'
){
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
now
=
Date
.
now
();
// performance.now()
const
elapsed
=
f
(
7
,
''
+
Math
.
trunc
((
now
-
startTime
)
/
1000
));
const
elapsed
=
f
(
7
,
''
+
Math
.
trunc
((
now
-
startTime
)
/
1000
));
const
speed
=
f
(
5
,
''
+
Math
.
trunc
((
x
/
PARALLEL_THREAD
)
/
((
now
-
startTime
)
/
1000
)));
const
speed
=
f
(
5
,
''
+
Math
.
trunc
((
x
/
PARALLEL_THREAD
)
/
((
now
-
startTime
)
/
1000
)));
...
@@ -34,15 +34,15 @@ function main() {
...
@@ -34,15 +34,15 @@ function main() {
partialLevel
=
2
;
partialLevel
=
2
;
console
.
log
(
`
${
speed
}
/s écoulé:
${
elapsed
}
s seed:
${
f
(
44
,
strX
)}
pubKey:
${
f
(
44
,
pubKey
)}
`
);
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
){
if
(
partialLevel
<
4
){
partialLevel
=
3
;
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
)
console
.
log
(
`
${
speed
}
/s écoulé:
${
elapsed
}
s seed:
${
f
(
44
,
strX
)}
pubKey:
${
f
(
44
,
pubKey
)
}
chk:
${
app
.
pubKey2checksum
(
pubKey
)}
${
app
.
pubKey2checksum
(
pubKey
,
false
,
true
)
}
chk:
${
duniCrypto
.
pubKey2checksum
(
pubKey
)}
${
duniCrypto
.
pubKey2checksum
(
pubKey
,
false
,
true
)
}
${
app
.
pubKey2checksum
(
pubKey
,
true
)}
${
app
.
pubKey2checksum
(
pubKey
,
true
,
true
)}
`
);
}
${
duniCrypto
.
pubKey2checksum
(
pubKey
,
true
)}
${
duniCrypto
.
pubKey2checksum
(
pubKey
,
true
,
true
)}
`
);
return
;
return
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment