unique hash of string

与世无争的帅哥 提交于 2019-12-11 06:14:29

问题


I want to create a unique hash (16 chars long) of an arbitrary length String. Is there a good library that implements MD5 or SHA-1 for C++ with which I can achieve this? (and possibly an example of how to use it)


回答1:


The Pigeonhole Principle explains why what you ask is impossible regarding uniqueness.




回答2:


You need the openssl library. It has implementations of the standard crypto hashes for this purpose.




回答3:


nss provides a number of hash and cryptographic algorithms and has a more liberal license than OpenSSL.



来源:https://stackoverflow.com/questions/2444057/unique-hash-of-string

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!