Digest - MDN Web Docs Glossary: Definitions of Web-related terms 编辑
A digest is a small value generated by a hash function from a whole message. Ideally, a digest is quick to calculate, irreversible, and unpredictable, and therefore indicates whether someone has tampered with a given message.
A digest can be used to perform several tasks:
- in non-cryptographic applications (e.g., the index of hash tables, or a fingerprint used to detect duplicate data or to uniquely identify files)
- verify message integrity (a tampered message will have a different hash)
- store passwords so that they can't be retrieved, but can still be checked (To do this securely, you also need to salt the password.)
- generate pseudo-random numbers
- generate keys
It is critical to choose the proper hash function for your use case to avoid collisions and predictability.
Learn more
- See hash function
- Hash function on Wikipedia
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论