java调用com.google.guava
- 引入依赖
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>20.0</version>
</dependency>
- 调用方法
Hashing.murmur3_128().newHasher().putString(inputStr, StandardCharsets.UTF_8).hash().toString();
C#调用System.Data.HashFunction.MurmurHash
- nuget 添加System.Data.HashFunction.MurmurHash 引用
- 调用方法
var bytes = Encoding.UTF8.GetBytes(inputStr);
var hashConfig = new System.Data.HashFunction.MurmurHash.MurmurHash3Config();
hashConfig.Seed = 0;
hashConfig.HashSizeInBits = 128;
var murmurHash3 = System.Data.HashFunction.MurmurHash.MurmurHash3Factory.Instance.Create(hashConfig);
var hashString = murmurHash3.ComputeHash(bytes).AsHexString();