Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ayushch80
Copy link

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)

package.json Outdated
@@ -18,6 +18,7 @@
"blockies": "^0.0.2",
"bootstrap": "^4.6.0",
"core-js": "^3.6.5",
"crypto": "^1.0.1",
Copy link
Owner

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 ?

@bokub
Copy link
Owner

bokub commented Dec 19, 2022

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),
Copy link
Owner

@bokub bokub Dec 19, 2022

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 ?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah thats a typo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants