compat.xxhash
#includeExtremely fast non-cryptographic hash algorithm (XXH32/XXH64/XXH3)
#include <xxhash.h>
mcpp add compat.xxhash@0.8.3
用法
來自本倉庫自己的測試專案 —— CI 真的編譯並執行過,不是為了網站寫的。
// Behavioral test: the digests themselves, against upstream's own vectors.
//
// A hash package that links but computes a different value is worse than one
// that does not link at all — every caller downstream is content-addressing
// something. So the assertions here are known-answer tests taken verbatim from
// xxHash's `tests/sanity_test_vectors.h`, together with the buffer generator
// from `tests/sanity_test.c` that those vectors were computed over. Nothing is
// derived from running the code under test.
//
// The lengths cover every size branch XXH3 switches on (0, 1-3, 4-8, 9-16,
// 17-128, 129-240, >240) plus the multi-block path at 2048 and 4160, which is
// where a mis-selected SIMD variant or a byte-order slip would show up.
#include <xxhash.h>
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <vector>
namespace {
// tests/sanity_test.c: fillTestBuffer(). "Its values must not be changed."
// …
tests/examples/xxhash/tests/digest.cpp · 專案 tests/examples/xxhash
建置
- targets
xxhash (lib)- language
c++23- C standard
c11- import std
- no
- include dirs
*
原始檔 (1)
*/xxhash.c