- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中net.jpountz.xxhash.XXHash64.hash()
方法的一些代码示例,展示了XXHash64.hash()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XXHash64.hash()
方法的具体详情如下:
包路径:net.jpountz.xxhash.XXHash64
类名称:XXHash64
方法名:hash
[英]Compute the hash of the given ByteBuffer. The ByteBuffer#position() is moved in order to reflect bytes which have been read.
[中]计算给定字节缓冲区的哈希。字节缓冲#position()会被移动,以反映已读取的字节。
代码示例来源:origin: net.jpountz.lz4/lz4
/**
* Compute the hash of the given {@link ByteBuffer}. The
* {@link ByteBuffer#position() position} is moved in order to reflect bytes
* which have been read.
*/
public final long hash(ByteBuffer buf, long seed) {
final long hash = hash(buf, buf.position(), buf.remaining(), seed);
buf.position(buf.limit());
return hash;
}
代码示例来源:origin: com.github.swri-robotics/lz4
/**
* Compute the hash of the given {@link ByteBuffer}. The
* {@link ByteBuffer#position() position} is moved in order to reflect bytes
* which have been read.
*/
public final long hash(ByteBuffer buf, long seed) {
final long hash = hash(buf, buf.position(), buf.remaining(), seed);
buf.position(buf.limit());
return hash;
}
代码示例来源:origin: snazy/ohc
long hash(byte[] array)
{
return xx.hash64().hash(array, 0, array.length, 0);
}
}
代码示例来源:origin: yahoo/HaloDB
long hash(byte[] array) {
return xx.hash64().hash(array, 0, array.length, 0);
}
}
代码示例来源:origin: snazy/ohc
long hash(ByteBuffer buffer)
{
return xx.hash64().hash(buffer, 0);
}
}
代码示例来源:origin: org.caffinitas.ohc/ohc-core
long hash(ByteBuffer buffer)
{
return xx.hash64().hash(buffer, 0);
}
}
代码示例来源:origin: diennea/herddb
public static byte[] digest(byte[] array, int offset, int len) {
long hash = HASHER.hash(array, offset, len, DEFAULT_SEED);
byte[] digest = Bytes.longToByteArray(hash);
return digest;
}
代码示例来源:origin: org.caffinitas.ohc/ohc-core
long hash(byte[] array)
{
return xx.hash64().hash(array, 0, array.length, 0);
}
}
代码示例来源:origin: diennea/herddb
public static boolean verifyBlockWithFooter(byte[] array, int offset, int len) {
byte[] expectedFooter = Arrays.copyOfRange(array, len - HASH_LEN, len);
long expectedHash = HASHER.hash(array, offset, len - HASH_LEN, DEFAULT_SEED);
long hash = Bytes.toLong(expectedFooter, 0);
return hash == expectedHash;
}
代码示例来源:origin: com.orientechnologies/orientdb-core
private static boolean pageIsBroken(final ByteBuffer buffer, int walPageSize) {
buffer.position(OCASWALPage.MAGIC_NUMBER_OFFSET);
if (buffer.getLong() != OCASWALPage.MAGIC_NUMBER) {
return true;
}
final int pageSize = buffer.getShort(OCASWALPage.PAGE_SIZE_OFFSET);
if (pageSize == 0 || pageSize > walPageSize) {
return true;
}
buffer.limit(pageSize);
buffer.position(OCASWALPage.RECORDS_OFFSET);
final XXHash64 hash64 = xxHashFactory.hash64();
final long hash = hash64.hash(buffer, XX_SEED);
buffer.position(OCASWALPage.XX_OFFSET);
if (hash != buffer.getLong()) {
return true;
}
return false;
}
代码示例来源:origin: com.yahoo.vespa/filedistribution
public FileReferenceDataBlob(FileReference fileReference, String filename, Type type, byte[] content) {
this(fileReference, filename, type, content, XXHashFactory.fastestInstance().hash64().hash(ByteBuffer.wrap(content), 0));
}
代码示例来源:origin: snazy/ohc
long hash(long address, long offset, int length)
{
return xx.hash64().hash(Uns.directBufferFor(address, offset, length, true), 0);
}
代码示例来源:origin: org.caffinitas.ohc/ohc-core
long hash(long address, long offset, int length)
{
return xx.hash64().hash(Uns.directBufferFor(address, offset, length, true), 0);
}
代码示例来源:origin: yahoo/HaloDB
long hash(long address, long offset, int length) {
return xx.hash64().hash(Uns.directBufferFor(address, offset, length, true), 0);
}
代码示例来源:origin: com.github.swri-robotics/lz4
@Override
public long hash(ByteBuffer buf, int off, int len, long seed) {
if (buf.isDirect()) {
checkRange(buf, off, len);
return XXHashJNI.XXH64BB(buf, off, len, seed);
} else if (buf.hasArray()) {
return hash(buf.array(), off + buf.arrayOffset(), len, seed);
} else {
XXHash64 safeInstance = SAFE_INSTANCE;
if (safeInstance == null) {
safeInstance = SAFE_INSTANCE = XXHashFactory.safeInstance().hash64();
}
return safeInstance.hash(buf, off, len, seed);
}
}
代码示例来源:origin: net.jpountz.lz4/lz4
@Override
public long hash(ByteBuffer buf, int off, int len, long seed) {
if (buf.isDirect()) {
checkRange(buf, off, len);
return XXHashJNI.XXH64BB(buf, off, len, seed);
} else if (buf.hasArray()) {
return hash(buf.array(), off, len, seed);
} else {
XXHash64 safeInstance = SAFE_INSTANCE;
if (safeInstance == null) {
safeInstance = SAFE_INSTANCE = XXHashFactory.safeInstance().hash64();
}
return safeInstance.hash(buf, off, len, seed);
}
}
代码示例来源:origin: com.github.swri-robotics/lz4
private XXHashFactory(String impl) throws ClassNotFoundException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException {
this.impl = impl;
hash32 = classInstance("net.jpountz.xxhash.XXHash32" + impl);
streamingHash32Factory = classInstance("net.jpountz.xxhash.StreamingXXHash32" + impl + "$Factory");
hash64 = classInstance("net.jpountz.xxhash.XXHash64" + impl);
streamingHash64Factory = classInstance("net.jpountz.xxhash.StreamingXXHash64" + impl + "$Factory");
// make sure it can run
final byte[] bytes = new byte[100];
final Random random = new Random();
random.nextBytes(bytes);
final int seed = random.nextInt();
final int h1 = hash32.hash(bytes, 0, bytes.length, seed);
final StreamingXXHash32 streamingHash32 = newStreamingHash32(seed);
streamingHash32.update(bytes, 0, bytes.length);
final int h2 = streamingHash32.getValue();
final long h3 = hash64.hash(bytes, 0, bytes.length, seed);
final StreamingXXHash64 streamingHash64 = newStreamingHash64(seed);
streamingHash64.update(bytes, 0, bytes.length);
final long h4 = streamingHash64.getValue();
if (h1 != h2) {
throw new AssertionError();
}
if (h3 != h4) {
throw new AssertionError();
}
}
代码示例来源:origin: net.jpountz.lz4/lz4
private XXHashFactory(String impl) throws ClassNotFoundException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException {
this.impl = impl;
hash32 = classInstance("net.jpountz.xxhash.XXHash32" + impl);
streamingHash32Factory = classInstance("net.jpountz.xxhash.StreamingXXHash32" + impl + "$Factory");
hash64 = classInstance("net.jpountz.xxhash.XXHash64" + impl);
streamingHash64Factory = classInstance("net.jpountz.xxhash.StreamingXXHash64" + impl + "$Factory");
// make sure it can run
final byte[] bytes = new byte[100];
final Random random = new Random();
random.nextBytes(bytes);
final int seed = random.nextInt();
final int h1 = hash32.hash(bytes, 0, bytes.length, seed);
final StreamingXXHash32 streamingHash32 = newStreamingHash32(seed);
streamingHash32.update(bytes, 0, bytes.length);
final int h2 = streamingHash32.getValue();
final long h3 = hash64.hash(bytes, 0, bytes.length, seed);
final StreamingXXHash64 streamingHash64 = newStreamingHash64(seed);
streamingHash64.update(bytes, 0, bytes.length);
final long h4 = streamingHash64.getValue();
if (h1 != h2) {
throw new AssertionError();
}
if (h3 != h4) {
throw new AssertionError();
}
}
代码示例来源:origin: com.orientechnologies/orientdb-core
final long hash = xxHash64.hash(buffer, XX_SEED);
代码示例来源:origin: com.yahoo.vespa/filedistribution
void receive(FileReference reference, String filename, byte[] content) {
log.log(LogLevel.INFO, "Preparing receive call for " + reference.value() + " and file " + filename);
XXHash64 hasher = XXHashFactory.fastestInstance().hash64();
Request fileBlob = new Request("filedistribution.receiveFile");
log.log(LogLevel.INFO, "Calling " + fileBlob.methodName() + " with target " + target);
fileBlob.parameters().add(new StringValue(reference.value()));
fileBlob.parameters().add(new StringValue(filename));
fileBlob.parameters().add(new DataValue(content));
fileBlob.parameters().add(new Int64Value(hasher.hash(ByteBuffer.wrap(content), 0)));
fileBlob.parameters().add(new Int32Value(0));
fileBlob.parameters().add(new StringValue("OK"));
log.log(LogLevel.INFO, "Doing invokeSync");
target.invokeSync(fileBlob, 5);
log.log(LogLevel.INFO, "Done with invokeSync");
}
}
我正在使用 C# 的 xxHash 来对值进行散列以确保一致性。ComputeHash 返回一个 byte[],但我需要将结果存储在一个 long 中。 我可以使用 BitConverter 将结果转
我有一个 3GB 的文件,我需要使用 ruby xxhash 对其进行校验和图书馆。我遇到内存不足错误的问题。 这是导致错误的代码: contents = File.read('some_file
本文整理了Java中net.jpountz.xxhash.XXHash64类的一些代码示例,展示了XXHash64类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Mave
我正在使用 xxHash 从元素 id 创建哈希。我只是不想在网站上显示真实身份。我创建了脚本来测试是否有获取相同哈希值的选项: const _ = require('lodash'); const
我不明白this xxhash函数能够添加比 uint32 可以存储的更大的值。有人可以解释为什么这种魔法是可能的吗? static const U32 PRIME32_1 = 2654435
对于在线服务,我目前使用的是XXHash。现在我正在尝试为网上商店创建一个插件,但这些商店都在使用 PHP,主要是在共享托管平台上。问题是可用的 XXHash 插件都需要安装 XXHash 扩展。这在
本文整理了Java中net.jpountz.xxhash.XXHash64.hash()方法的一些代码示例,展示了XXHash64.hash()的具体用法。这些代码示例主要来源于Github/Stac
我目前正在更新/编写delphi binding for lz4 & xxHash . 带有编译器错误的项目状态 is available here . xxHash.pas 行不工作 functio
我正在尝试通过编译在 Mac 上安装 rsync 3.2.3。但是,我想安装所有功能。为此,它需要一些库,此处 ( https://download.samba.org/pub/rsync/INSTA
我是一名优秀的程序员,十分优秀!