nodejs / nodejs/node

Allow Hash object reuse

Open
#45,031 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

crypto feature request never-stale
Dominant language
JavaScript
Stars
122k
Forks
37.3k
Avg merge
4d 2h
Merged PRs (30d)
283

Description

What is the problem this feature will solve?

https://github.com/nodejs/node/issues/25857#issuecomment-466384613

I'm creating the hash of many small objects and need to keep track of these individual hashes so https://github.com/nodejs/node/issues/29903 doesn't work.

My specific use case is that I'm hashing directory layouts to setup a file layout that's optimal about symlinking entire directories when its filled with symlinked entries that all point to the same source directory. I can get into specifics if that matters.

What is the feature you are proposing to solve the problem?

crypto.Hash.reset() - reset the internal state of the hasher and allows it to be reused with any new allocations

What alternatives have you considered?

-not use crypto.hash in this case and write my own hasher
-create a native add on that lets me manage to hash context according to my needs

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No implementation files or tests are identified in the issue. Start by reading the two linked Node.js discussions and the existing crypto.Hash API context; done means a reset operation lets one Hash object be reused for new allocations while preserving separate hash results.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
api, cryptography
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.