nodejs / nodejs/node

Allow Hash object reuse

Offen
#45,031 7 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

crypto feature request never-stale
Vorherrschende Sprache
JavaScript
Sterne
122k
Forks
37.3k
Ø Merge
4 T. 2 Std.
Gemergte PRs (30 T.)
283

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

In der Issue sind keine Implementierungsdateien oder Tests angegeben. Beginne damit, die beiden verlinkten Node.js-Diskussionen und den bestehenden Kontext der crypto.Hash API zu lesen; die Arbeit ist abgeschlossen, wenn eine Reset-Operation ermöglicht, dass ein Hash-Objekt für neue Allokationen wiederverwendet werden kann, während separate Hash-Ergebnisse erhalten bleiben.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript, node.js
Bereich
api, cryptography
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.