-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
slight improvement in performance #50
base: master
Are you sure you want to change the base?
Conversation
package.json
Outdated
@@ -18,6 +18,7 @@ | |||
"blockies": "^0.0.2", | |||
"bootstrap": "^4.6.0", | |||
"core-js": "^3.6.5", | |||
"crypto": "^1.0.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use this module that has been deprecated for years instead of using the native Node.js crypto module ?
Thanks for this PR ! I will run some benchmarks to measure the difference |
return { | ||
address: privateToAddress(randbytes).toString('hex'), | ||
privKey: randbytes.toString('hex') | ||
address: '0x' + crypto.createHash('sha3-256').update(privateKey).digest('hex').slice(24), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
privateKey
is not defined, do you mean privateKeyBytes
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah thats a typo
Few days ago I made a JS application that was able to generate 1M addresses within 10 seconds so I implemented some of its code here which may bring some sort of improvement in performance (didn't tested by own)