Class MetroHash64
java.lang.Object
org.miaixz.bus.core.codec.hash.metro.AbstractMetroHash<MetroHash64>
org.miaixz.bus.core.codec.hash.metro.MetroHash64
- All Implemented Interfaces:
Encoder<byte[],,Number> Hash64<byte[]>,MetroHash<MetroHash64>
Apache 发布的MetroHash算法的64位实现,是一组用于非加密用例的最先进的哈希函数。 除了卓越的性能外,他们还以算法生成而著称。
官方实现:https://github.com/jandrewrogers/MetroHash 官方文档:http://www.jandrewrogers.com/2015/05/27/metrohash/ 来自:https://github.com/postamar/java-metrohash/
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongget()获取计算结果hash值longhash64(byte[] bytes) 计算Hash值static MetroHash64of(long seed) 创建MetroHash64对象reset()重置,重置后可复用对象开启新的计算write(ByteBuffer output, ByteOrder byteOrder) 将结果hash值写出到ByteBuffer中,可选端序Methods inherited from class org.miaixz.bus.core.codec.hash.metro.AbstractMetroHash
apply
-
Constructor Details
-
MetroHash64
public MetroHash64(long seed) 使用指定种子构造- Parameters:
seed- 种子
-
-
Method Details
-
of
创建MetroHash64对象- Parameters:
seed- 种子- Returns:
MetroHash64对象
-
reset
Description copied from interface:MetroHash重置,重置后可复用对象开启新的计算- Specified by:
resetin interfaceMetroHash<MetroHash64>- Returns:
- this
-
get
public long get()获取计算结果hash值- Returns:
- hash值
-
hash64
public long hash64(byte[] bytes) Description copied from interface:Hash64计算Hash值 -
write
Description copied from interface:MetroHash将结果hash值写出到ByteBuffer中,可选端序- Specified by:
writein interfaceMetroHash<MetroHash64>- Parameters:
output- 输出byteOrder- 端序- Returns:
- this
-