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.