且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

短字符串(标签名称)的*** 32 位哈希函数是什么?

更新时间:2023-11-06 16:32:28

如果性能不重要,只需采用安全散列(例如 MD5 或 SHA1),并将其输出截断为 32 位.这将为您提供与随机无法区分的哈希码分布.

If performance isn't important, simply take a secure hash such as MD5 or SHA1, and truncate its output to 32 bits. This will give you a distribution of hash codes that's indistinguishable from random.