Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想创建一个任意长度字符串的唯一哈希(16 个字符长)。是否有一个为 C++ 实现 MD5 或 SHA-1 的好库,我可以用它来实现这一点?(可能还有一个如何使用它的例子)
Pigeonhole原则解释了为什么你所问的关于唯一性的问题是不可能的。
您需要 openssl 库。它为此目的实现了标准加密哈希。
nss提供了许多散列和加密算法,并且拥有比 OpenSSL 更自由的许可证。