nodejs / nodejs/node

Allow Hash object reuse

未关闭
#45,031 7 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

crypto feature request never-stale
主要语言
JavaScript
星标
122k
派生
37.4k
平均合并
4 天 3 小时
30 天内合并 PR
272

描述

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

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

Issue 中没有指出实现文件或测试。首先阅读链接的两篇 Node.js 讨论以及现有的 crypto.Hash API 上下文;完成的标准是,reset 操作可以让一个 Hash 对象用于新的分配,同时保留彼此独立的哈希结果。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript, node.js
领域
api, cryptography
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。