npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-hash-checksum

v0.1.0

Published

Hash & checksum plugin for DeepSeek Harness: md5/sha1/sha256/sha512 for text and files (streamed, constant memory), checksum verification with prefix parsing and length-mismatch hints. Zero runtime dependencies.

Readme

dsh-hash-checksum

DeepSeek Harness 哈希与校验和插件:文本/文件 md5/sha1/sha256/sha512 摘要,校验和比对验证。文件采用流式读取,内存占用恒定。零运行时依赖。

安装

npm install dsh-hash-checksum

使用说明

hash_text —— 文本哈希

用户:算一下 "abc" 的 sha256

sha256:ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad  (256 bit, 32 字节摘要)
输入:3 字节

参数:text(必填,上限 5MB)、algorithm(md5 | sha1 | sha256 | sha512,默认 sha256)、upper(大写输出,默认 false)。

hash_file —— 文件哈希(流式)

按 1MB 分块流式读取,任意大小文件(上限 512MB)内存占用恒定,不会把整个文件读进内存。

用户:算一下下载的安装包的 sha256,和官网对一下

sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08  (256 bit, 32 字节摘要)
文件:E:\downloads\setup.exe(48214456 字节,流式读取)

参数:path(必填)、algorithm、upper。

verify_checksum —— 校验和比对

计算实际哈希并与期望值比对,输出 ✅/❌ 结论,期望值与实际值都完整展示便于人工复核。

用户:这个文件的 sha256 应该是 9f86d081...a08,帮我验证一下

✅ 校验一致
算法:sha256
期望:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08
实际:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08
对象:文件 E:\downloads\setup.exe(48214456 字节)

参数:

  • expected(必填):期望校验和,支持 sha256:abc... 前缀(大小写不敏感)或裸 hex
  • text / path:二选一
  • algorithm:默认 sha256;expected 带前缀时以前缀为准,两者冲突会报错

期望值长度与摘要长度不符时(如拿 md5 值验 sha256),会提示「可能复制错了算法的校验和」。

统计口径

  • 字节数按 UTF-8 编码计(Hello 世界 = 12 字节)。
  • 摘要输出为 hex:md5/sha1/sha256/sha512 分别为 32/40/64/128 字符。
  • 文件哈希对 0 字节文件同样有效(空文件也有确定摘要)。

安全边界

  • md5 / sha1 已被证实存在碰撞攻击,仅适用于下载校验和、去重、缓存键等非对抗场景;本插件在输出中自动附提示。
  • 完整性防篡改、签名、密码存储请分别使用 sha256/HMAC/argon2 等方案,本插件不提供。
  • verify_checksum 的比对在本地完成,期望值来源(官网、作者公布)的可信性需自行判断。

版本历史

  • 0.1.0:初始版本——hash_text / hash_file(流式)/ verify_checksum(前缀解析、大小写不敏感、长度不匹配提示)。

FAQ

Q:大文件会撑爆内存吗? 不会。文件按 1MB 分块流式读取,内存占用与文件大小无关(上限 512MB)。

Q:为什么 md5 结果带警告? md5/sha1 存在已知碰撞攻击,用于校验和场景没问题,但不可用于防篡改。警告只是提醒,不影响计算。

Q:能算 CRC32 吗? 不能。CRC32 不是密码学哈希且 Node 内置 crypto 不支持,本插件限定四种 SHA 系算法。

许可证

MIT