mcpp index

compat.xxhash

#include

Extremely 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

openkal

目标结果环境测试项目首条诊断
x86_64-linux-gnurunsposixxxhash
x86_64-windows-muslrunsposixxxhash

测量方式

2026-09-23 由 tests/openkal/compat.py 测得,使用 openkal-llvm-runtime 0.15.1、llvm@22.1.8、mcpp 2026.9.21.3。测试项目没有自行选择平台依赖。 上方徽章是所有已测目标里最严格那个的结果 —— 上表列出每个目标各自的环境。

构建

targets
xxhash (lib)
language
c++23
C standard
c11
import std
no
include dirs
*

源文件 (1)

  • */xxhash.c

版本

版本平台 镜像sha256
0.8.3 最新 LinuxWindowsmacOS CN GLOBAL aae608dfe821…