Mac 下验证下载文件的 MD5/SHA1/SHA256

验证SHA-256

openssl dgst -sha256 /path/to/file
  • 1

验证SHA-1

openssl sha1 /path/to/file
  • 1

验证 MD5

openssl md5 /path/to/file
  • 1

备注

  1. MD5已经不再安全,推荐使用 SHA-256
  2. 最新的 macOS好像可以通过md5 /path/to/file的命令来验证MD5了,而sha256和sha1则没有这么直观的方式。不妨在 .bashrc / .zshrc 里加入一行alias sha256="openssl dgst -sha256"来实现通过sha256 /path/to/file校验 SHA256
  3. 文件路径不一定要手动打,可以拖拽文件到 terminal

原创文章,作者:奋斗,如若转载,请注明出处:https://blog.ytso.com/tech/dev/318590.html

(0)
上一篇 2025年12月9日 11:05
下一篇 2022年1月6日 20:45

相关推荐

发表回复

登录后才能评论