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.
我需要一个产生 long 的统一字符串哈希,用于布隆过滤器。我在哪里可以找到用于此的算法或库?谢谢。
你可以做什么String.hashCode,只使用长:
String.hashCode
val code = string.foldLeft(0L) { case (code, c) => 31*code + c }