We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When you run this simple code, memory grows unbounded. In my test it leaked more than 5 GB of memory.
import createKeccakHash from 'keccak' const hash = msg => { return '0x' + createKeccakHash('keccak256').update(msg).digest('hex') } const mine = function(seed, difficulty = 5) { let nonce = 0; difficulty = parseInt(difficulty); const prefix = '0x' + new Array(difficulty).fill('0').join('') while (true) { const h = hash(seed + nonce); if (!!h && h.substring(0, difficulty+2) === prefix) { return nonce; } nonce += 1; } } console.log("running ....") const seed = "hfjshjdhsjhdjshdjs" const nonce = mine(seed, 8) console.log({ nonce, })
the createKeccakHash method thakes some memory and not release it.
createKeccakHash
The text was updated successfully, but these errors were encountered:
I noticed this as well. Seems like a problem specific to the node bindings. When importing keccak/js instead, it did not leak.
Sorry, something went wrong.
No branches or pull requests
When you run this simple code, memory grows unbounded. In my test it leaked more than 5 GB of memory.
the
createKeccakHash
method thakes some memory and not release it.The text was updated successfully, but these errors were encountered: