#include <stddef.h>#include <stdlib.h>#include <string.h>#include <limits.h>#include <altivec.h>データ構造 | |
| struct | XXH32_canonical_t |
| XXH32_hash_tの正規(ビッグエンディアン)表現。 詳細… | |
| struct | XXH64_canonical_t |
| XXH64_hash_tの正規(ビッグエンディアン)表現。 詳細… | |
| struct | XXH128_hash_t |
| 128ビットハッシュの戻り値。 詳細… | |
| struct | XXH128_canonical_t |
| struct | XXH32_state_s |
| struct | XXH64_state_s |
| struct | XXH3_state_s |
マクロ | |
| #define | XXH_STATIC_LINKING_ONLY |
| 静的な割り当てに必要な内部状態の宣言にアクセスできるようにします。 | |
| #define | XXH_IMPLEMENTATION |
| 内部定義にアクセスできるようにします。 | |
| #define | XXH_INLINE_ALL |
| 実装を公開し、すべての関数を inlineとして指定します。 | |
| #define | XXH_PRIVATE_API |
| 関数をinlineとして指定せずに、実装を公開します。 | |
| #define | XXH_NAMESPACE /* YOUR NAME HERE */ |
| すべてのシンボルに透過的に接頭辞を付け、名前空間を模倣します。 | |
| #define | XXH_CAT(A, B) |
| #define | XXH_NAME2(A, B) |
| #define | XXH_IPREF(Id) |
| #define | XXHASH_H_5627135585666179 1 |
| #define | XXH_PUBLIC_API /* do nothing */ |
| グローバルシンボルを指定します。 | |
| #define | XXH_PUBLIC_API /* do nothing */ |
| グローバルシンボルを指定します。 | |
| #define | XXH_CONSTF /* disable */ |
| #define | XXH_PUREF |
| #define | XXH_MALLOCF |
| #define | XXH_VERSION_MAJOR 0 |
| #define | XXH_VERSION_MINOR 8 |
| #define | XXH_VERSION_RELEASE 4 |
| #define | XXH_VERSION_NUMBER (XXH_VERSION_MAJOR *100*100 + XXH_VERSION_MINOR *100 + XXH_VERSION_RELEASE) |
| 各要素を2桁で符号化したバージョン番号。 | |
| #define | XXH_SCALAR 0 |
| XXH_VECTORに指定できる値。 | |
| #define | XXH_SSE2 1 |
| #define | XXH_AVX2 2 |
| #define | XXH_AVX512 3 |
| #define | XXH_NEON 4 |
| #define | XXH_VSX 5 |
| #define | XXH_SVE 6 |
| #define | XXH_LSX 7 |
| #define | XXH_LASX 8 |
| #define | XXH_RVV 9 |
| #define | XXH3_SECRET_SIZE_MIN 136 |
| #define | XXHASH_H_STATIC_13879238742 |
| #define | XXH_ALIGN(n) |
| #define | XXH_ALIGN_MEMBER(align, type) |
| #define | XXH3_INTERNALBUFFER_SIZE 256 |
| #define | XXH3_SECRET_DEFAULT_SIZE 192 |
| 既定のシークレットのサイズ。 | |
| #define | XXH3_INITSTATE(XXH3_state_ptr) |
| スタックに割り当てたXXH3_state_sを初期化します。 | |
| #define | XXH3_MIDSIZE_MAX 240 |
| 「短い」キーの最大サイズ(バイト単位)。 | |
| #define | XXH_IMPLEM_13a8737387 |
| #define | XXH_NO_LONG_LONG |
| 64ビットのコードを無効にする場合に定義します。 | |
| #define | XXH_FORCE_MEMORY_ACCESS 0 |
| アライメントされていないメモリーへのアクセス方法を制御します。 | |
| #define | XXH_SIZE_OPT 0 |
| xxHashのサイズ最適化の程度を制御します。 | |
| #define | XXH_FORCE_ALIGN_CHECK 0 |
| 0以外に定義すると、アライメントされた入力用の特別な処理経路を追加します(XXH32() と XXH64() のみ)。 | |
| #define | XXH_NO_INLINE_HINTS 0 |
| 0以外の場合、すべての関数を staticとして指定します。 | |
| #define | XXH3_INLINE_SECRET 0 |
| XXH3のwithSecretコードをインライン化するかどうかを決めます。 | |
| #define | XXH32_ENDJMP 0 |
| XXH32_finalizeでジャンプを使うかどうかを制御します。 | |
| #define | XXH_OLD_NAMES |
| #define | XXH_NO_STREAM |
| ストリーミングAPIを無効にします。 | |
| #define | XXH_memcpy memcpy |
| #define | XXH_memset memset |
| #define | XXH_memcmp memcmp |
| #define | XXH_FORCE_INLINE static |
| #define | XXH_NO_INLINE static |
| #define | XXH_STATIC static |
| #define | XXH3_WITH_SECRET_INLINE XXH_NO_INLINE |
| #define | XXH_RESTRICT /* disable */ |
| #define | XXH_DEBUGLEVEL 0 |
| デバッグレベルを設定します。 | |
| #define | XXH_ASSERT(c) |
| #define | XXH_STATIC_ASSERT_WITH_MESSAGE(c, m) |
| #define | XXH_STATIC_ASSERT(c) |
| #define | XXH_COMPILER_GUARD(var) |
| #define | XXH_COMPILER_GUARD_CLANG_NEON(var) |
| #define | XXH_CPU_LITTLE_ENDIAN XXH_isLittleEndian() |
| 対象がリトルエンディアンかどうかを示します。 | |
| #define | XXH_GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__) |
| #define | XXH_HAS_BUILTIN(x) |
| #define | XXH_UNREACHABLE() |
| #define | XXH_ASSUME(c) |
| #define | XXH_rotl32(x, r) |
| #define | XXH_rotl64(x, r) |
| #define | XXH_PRIME32_1 0x9E3779B1U |
| #define | XXH_PRIME32_2 0x85EBCA77U |
| #define | XXH_PRIME32_3 0xC2B2AE3DU |
| #define | XXH_PRIME32_4 0x27D4EB2FU |
| #define | XXH_PRIME32_5 0x165667B1U |
| #define | XXH_get32bits(p) |
| #define | XXH_PROCESS1 |
| #define | XXH_PROCESS4 |
| #define | XXH_PRIME64_1 0x9E3779B185EBCA87ULL |
| #define | XXH_PRIME64_2 0xC2B2AE3D27D4EB4FULL |
| #define | XXH_PRIME64_3 0x165667B19E3779F9ULL |
| #define | XXH_PRIME64_4 0x85EBCA77C2B2AE63ULL |
| #define | XXH_PRIME64_5 0x27D4EB2F165667C5ULL |
| #define | XXH_get64bits(p) |
| #define | XXH_likely(x) |
| #define | XXH_unlikely(x) |
| #define | XXH_HAS_INCLUDE(x) |
| #define | XXH_VECTOR XXH_SCALAR |
| XXH3用に選択されるベクトル化の実装を上書きします。 | |
| #define | XXH_ACC_ALIGN 8 |
| XXH3のアキュムレーターの最小アライメントを選択します。 | |
| #define | XXH_VECTOR XXH_SCALAR |
| XXH3用に選択されるベクトル化の実装を上書きします。 | |
| #define | XXH_SEC_ALIGN XXH_ACC_ALIGN |
| #define | XXH_ALIASING /* nothing */ |
| #define | XXH3_NEON_LANES XXH_ACC_NB |
| XXH3でのNEONとスカラーの比率を制御します。 | |
| #define | XXH_VSX_BE 0 |
| #define | ACCRND(acc, offset) |
| #define | XXH_PREFETCH(ptr) |
| #define | XXH_SECRET_DEFAULT_SIZE 192 /* minimum XXH3_SECRET_SIZE_MIN */ |
| #define | XXH3_MIDSIZE_STARTOFFSET 3 |
| #define | XXH3_MIDSIZE_LASTOFFSET 17 |
| #define | XXH_STRIPE_LEN 64 |
| #define | XXH_SECRET_CONSUME_RATE 8 /* nb of secret bytes consumed at each accumulation */ |
| #define | XXH_ACC_NB (XXH_STRIPE_LEN / sizeof(xxh_u64)) |
| #define | XXH_PREFETCH_DIST 512 |
| #define | XXH3_ACCUMULATE_TEMPLATE(name) |
| #define | XXH_TARGET_AVX512 /* disable attribute target */ |
| XXH_TARGET_SSE2と同様ですが、AVX512向けです。 | |
| #define | XXH_TARGET_AVX2 /* disable attribute target */ |
| XXH_TARGET_SSE2と同様ですが、AVX2向けです。 | |
| #define | XXH_TARGET_SSE2 /* disable attribute target */ |
| 関数をSSE2組み込み関数でコンパイルできるようにします。 | |
| #define | _LSX_SHUFFLE(z, y, x, w) |
| #define | _LASX_SHUFFLE(z, y, x, w) |
| #define | XXH_CONCAT2(X, Y) |
| #define | XXH_CONCAT(X, Y) |
| #define | XXH_RVOP(op) |
| #define | XXH_RVCAST(op) |
| #define | XXH3_accumulate_512 XXH3_accumulate_512_avx512 |
| #define | XXH3_accumulate XXH3_accumulate_avx512 |
| #define | XXH3_scrambleAcc XXH3_scrambleAcc_avx512 |
| #define | XXH3_initCustomSecret XXH3_initCustomSecret_avx512 |
| #define | XXH_SECRET_LASTACC_START 7 /* not aligned on 8, last secret is different from acc & scrambler */ |
| #define | XXH_SECRET_MERGEACCS_START 11 |
| #define | XXH3_INIT_ACC |
| #define | XXH3_STREAM_USE_STACK 1 |
| #define | XXH3_INTERNALBUFFER_STRIPES (XXH3_INTERNALBUFFER_SIZE / XXH_STRIPE_LEN) |
| #define | XXH_MIN(x, y) |
型定義 | |
| typedef uint32_t | XXH32_hash_t |
| 符号なし32ビット整数。 | |
| typedef struct XXH32_state_s | XXH32_state_t |
| XXH32ストリーミングAPI用の不透明な状態構造体。 | |
| typedef struct XXH64_state_s | XXH64_state_t |
| XXH64ストリーミングAPI用の不透明な状態構造体。 | |
| typedef struct XXH3_state_s | XXH3_state_t |
| XXH3ストリーミングAPI用の不透明な状態構造体。 | |
| typedef unsigned char | xxh_u8 |
| typedef XXH32_hash_t | xxh_u32 |
| typedef uint64x2_t xxh_aliasing_uint64x2_t | XXH_ALIASING |
| typedef __vector unsigned long long | xxh_u64x2 |
| typedef __vector unsigned char | xxh_u8x16 |
| typedef __vector unsigned | xxh_u32x4 |
| typedef long long | xxh_i64 |
| typedef void(* | XXH3_f_accumulate) (xxh_u64 *restrict, const xxh_u8 *restrict, const xxh_u8 *restrict, size_t) |
| typedef void(* | XXH3_f_scrambleAcc) (void *restrict, const void *) |
| typedef void(* | XXH3_f_initCustomSecret) (void *restrict, xxh_u64) |
| typedef XXH64_hash_t(* | XXH3_hashLong64_f) (const void *restrict, size_t, XXH64_hash_t, const xxh_u8 *restrict, size_t) |
| typedef XXH128_hash_t(* | XXH3_hashLong128_f) (const void *restrict, size_t, XXH64_hash_t, const void *restrict, size_t) |
| typedef uint64_t | XXH64_hash_t |
| 符号なし64ビット整数。 | |
列挙型 | |
| enum | XXH_errorcode { XXH_OK = 0 , XXH_ERROR } |
| ストリーミングAPIの終了コード。 詳細… | |
| enum | XXH_alignment { XXH_aligned , XXH_unaligned } |
関数 | |
| unsigned | XXH_versionNumber (void) |
| xxHashのバージョンを取得します。 | |
| XXH32_hash_t | XXH32 (const void *input, size_t length, XXH32_hash_t seed) |
inputの32ビットハッシュをxxHash32で計算します。 | |
| XXH32_state_t * | XXH32_createState (void) |
| XXH32_state_tを割り当てます。 | |
| XXH_errorcode | XXH32_freeState (XXH32_state_t *statePtr) |
| XXH32_state_tを解放します。 | |
| void | XXH32_copyState (XXH32_state_t *dst_state, const XXH32_state_t *src_state) |
| XXH32_state_tの状態を別の状態にコピーします。 | |
| XXH_errorcode | XXH32_reset (XXH32_state_t *statePtr, XXH32_hash_t seed) |
| 新しいハッシュの計算を開始するため、XXH32_state_tをリセットします。 | |
| XXH_errorcode | XXH32_update (XXH32_state_t *statePtr, const void *input, size_t length) |
inputのブロックを取り込み、XXH32_state_tに反映します。 | |
| XXH32_hash_t | XXH32_digest (const XXH32_state_t *statePtr) |
| XXH32_state_tから計算したハッシュ値を返します。 | |
| void | XXH32_canonicalFromHash (XXH32_canonical_t *dst, XXH32_hash_t hash) |
| XXH32_hash_tをビッグエンディアンのXXH32_canonical_tへ変換します。 | |
| XXH32_hash_t | XXH32_hashFromCanonical (const XXH32_canonical_t *src) |
| XXH32_canonical_tをネイティブ形式のXXH32_hash_tへ変換します。 | |
| XXH64_hash_t | XXH64 (const void *input, size_t length, XXH64_hash_t seed) |
inputの64ビットハッシュをxxHash64で計算します。 | |
| XXH64_state_t * | XXH64_createState (void) |
| XXH64_state_tを割り当てます。 | |
| XXH_errorcode | XXH64_freeState (XXH64_state_t *statePtr) |
| XXH64_state_tを解放します。 | |
| void | XXH64_copyState (XXH64_state_t *dst_state, const XXH64_state_t *src_state) |
| XXH64_state_tの状態を別の状態にコピーします。 | |
| XXH_errorcode | XXH64_reset (XXH64_state_t *statePtr, XXH64_hash_t seed) |
| 新しいハッシュの計算を開始するため、XXH64_state_tをリセットします。 | |
| XXH_errorcode | XXH64_update (XXH64_state_t *statePtr, const void *input, size_t length) |
inputのブロックを取り込み、XXH64_state_tに反映します。 | |
| XXH64_hash_t | XXH64_digest (const XXH64_state_t *statePtr) |
| XXH64_state_tから計算したハッシュ値を返します。 | |
| void | XXH64_canonicalFromHash (XXH64_canonical_t *dst, XXH64_hash_t hash) |
| XXH64_hash_tをビッグエンディアンのXXH64_canonical_tへ変換します。 | |
| XXH64_hash_t | XXH64_hashFromCanonical (const XXH64_canonical_t *src) |
| XXH64_canonical_tをネイティブ形式のXXH64_hash_tへ変換します。 | |
| XXH64_hash_t | XXH3_64bits (const void *input, size_t length) |
inputのXXH3ハッシュをシードなし64ビット版で計算します。 | |
| XXH64_hash_t | XXH3_64bits_withSeed (const void *input, size_t length, XXH64_hash_t seed) |
inputのXXH3ハッシュをシード付き64ビット版で計算します。 | |
| XXH64_hash_t | XXH3_64bits_withSecret (const void *data, size_t len, const void *secret, size_t secretSize) |
| カスタム「シークレット」を使用して、XXH3の64ビット版を計算します。 | |
| XXH3_state_t * | XXH3_createState (void) |
| XXH3_state_tを割り当てます。 | |
| XXH_errorcode | XXH3_freeState (XXH3_state_t *statePtr) |
| XXH3_state_tを解放します。 | |
| void | XXH3_copyState (XXH3_state_t *dst_state, const XXH3_state_t *src_state) |
| XXH3_state_tの状態を別の状態にコピーします。 | |
| XXH_errorcode | XXH3_64bits_reset (XXH3_state_t *statePtr) |
| 新しいハッシュの計算を開始するため、XXH3_state_tをリセットします。 | |
| XXH_errorcode | XXH3_64bits_reset_withSeed (XXH3_state_t *statePtr, XXH64_hash_t seed) |
| 64ビットのシードを使って新しいハッシュの計算を開始するため、XXH3_state_tをリセットします。 | |
| XXH_errorcode | XXH3_64bits_reset_withSecret (XXH3_state_t *statePtr, const void *secret, size_t secretSize) |
| シークレットデータを使って新しいハッシュの計算を開始するため、XXH3_state_tをリセットします。 | |
| XXH_errorcode | XXH3_64bits_update (XXH3_state_t *statePtr, const void *input, size_t length) |
inputのブロックを取り込み、XXH3_state_tに反映します。 | |
| XXH64_hash_t | XXH3_64bits_digest (const XXH3_state_t *statePtr) |
| XXH3_state_tから計算したXXH3の64ビットハッシュ値を返します。 | |
| XXH128_hash_t | XXH3_128bits (const void *data, size_t len) |
dataのXXH3ハッシュをシードなし128ビット版で計算します。 | |
| XXH128_hash_t | XXH3_128bits_withSeed (const void *data, size_t len, XXH64_hash_t seed) |
dataのXXH3ハッシュをシード付き128ビット版で計算します。 | |
| XXH128_hash_t | XXH3_128bits_withSecret (const void *data, size_t len, const void *secret, size_t secretSize) |
| カスタム「シークレット」を使用して、XXH3の128ビット版を計算します。 | |
| XXH_errorcode | XXH3_128bits_reset (XXH3_state_t *statePtr) |
| 新しいハッシュの計算を開始するため、XXH3_state_tをリセットします。 | |
| XXH_errorcode | XXH3_128bits_reset_withSeed (XXH3_state_t *statePtr, XXH64_hash_t seed) |
| 64ビットのシードを使って新しいハッシュの計算を開始するため、XXH3_state_tをリセットします。 | |
| XXH_errorcode | XXH3_128bits_reset_withSecret (XXH3_state_t *statePtr, const void *secret, size_t secretSize) |
| シークレットデータを使って新しいハッシュの計算を開始するため、XXH3_state_tをリセットします。 | |
| XXH_errorcode | XXH3_128bits_update (XXH3_state_t *statePtr, const void *input, size_t length) |
inputのブロックを取り込み、XXH3_state_tに反映します。 | |
| XXH128_hash_t | XXH3_128bits_digest (const XXH3_state_t *statePtr) |
| XXH3_state_tから計算したXXH3の128ビットハッシュ値を返します。 | |
| int | XXH128_isEqual (XXH128_hash_t h1, XXH128_hash_t h2) |
| 2つのXXH128_hash_tの値が等しいかを調べます。 | |
| int | XXH128_cmp (const void *h128_1, const void *h128_2) |
| 2つのXXH128_hash_tの値を比較します。 | |
| void | XXH128_canonicalFromHash (XXH128_canonical_t *dst, XXH128_hash_t hash) |
| XXH128_hash_tをビッグエンディアンのXXH128_canonical_tへ変換します。 | |
| XXH128_hash_t | XXH128_hashFromCanonical (const XXH128_canonical_t *src) |
| XXH128_canonical_tをネイティブ形式のXXH128_hash_tへ変換します。 | |
| XXH128_hash_t | XXH128 (const void *data, size_t len, XXH64_hash_t seed) |
dataの128ビットハッシュをXXH3で計算します。 | |
| XXH_errorcode | XXH3_generateSecret (void *secretBuffer, size_t secretSize, const void *customSeed, size_t customSeedSize) |
| customSeedという名前の任意のユーザー定義コンテンツから、高エントロピーのシークレットを導出します。 | |
| void | XXH3_generateSecret_fromSeed (void *secretBuffer, XXH64_hash_t seed) |
| _withSeed()版と同じシークレットを生成します。 | |
| XXH64_hash_t | XXH3_64bits_withSecretandSeed (const void *data, size_t len, const void *secret, size_t secretSize, XXH64_hash_t seed) |
dataのXXH3ハッシュをシード付き64/128ビット版で計算します。 | |
| XXH128_hash_t | XXH3_128bits_withSecretandSeed (const void *input, size_t length, const void *secret, size_t secretSize, XXH64_hash_t seed64) |
dataのXXH3ハッシュをシード付き128ビット版で計算します。 | |
| XXH_errorcode | XXH3_64bits_reset_withSecretandSeed (XXH3_state_t *statePtr, const void *secret, size_t secretSize, XXH64_hash_t seed64) |
| シークレットデータを使って新しいハッシュの計算を開始するため、XXH3_state_tをリセットします。 | |
| XXH_errorcode | XXH3_128bits_reset_withSecretandSeed (XXH3_state_t *statePtr, const void *secret, size_t secretSize, XXH64_hash_t seed64) |
| シークレットデータを使って新しいハッシュの計算を開始するため、XXH3_state_tをリセットします。 | |
| XXH_STATIC xxh_u64 | XXH64_finalize (xxh_u64 hash, const xxh_u8 *ptr, size_t len, XXH_alignment align) |
| XXH_STATIC_ASSERT (XXH_STRIPE_LEN==sizeof(__m512i)) | |
| for (i=0;i< XXH_STRIPE_LEN/sizeof(__m256i);i++) | |
| for (;count > 0;count -=vl, xacc+=vl, xsecret+=vl *8) | |
| XXH_ASSERT ((((size_t) acc) &(XXH_ACC_ALIGN-1))==0) | |
| XXH_ASSERT (lane< XXH_ACC_NB) | |
| XXH3_WITH_SECRET_INLINE XXH64_hash_t | XXH3_hashLong_64b_withSecret (const void *restrict input, size_t len, XXH64_hash_t seed64, const xxh_u8 *restrict secret, size_t secretLen) |
| XXH3_WITH_SECRET_INLINE XXH128_hash_t | XXH3_hashLong_128b_withSecret (const void *restrict input, size_t len, XXH64_hash_t seed64, const void *restrict secret, size_t secretLen) |
変数 | |
| static XXH_TARGET_AVX512 const void *restrict | secret |
| const __m512i | prime32 = _mm512_set1_epi32((int)XXH_PRIME32_1) |
| __m512i const | acc_vec = *xacc |
| __m512i const | shifted = _mm512_srli_epi64 (acc_vec, 47) |
| __m512i const | key_vec = _mm512_loadu_si512 (secret) |
| __m512i const | data_key = _mm512_ternarylogic_epi32(key_vec, acc_vec, shifted, 0x96 ) |
| __m512i const | data_key_hi = _mm512_srli_epi64 (data_key, 32) |
| __m512i const | prod_lo = _mm512_mul_epu32 (data_key, prime32) |
| __m512i const | prod_hi = _mm512_mul_epu32 (data_key_hi, prime32) |
| * | xacc = _mm512_add_epi64(prod_lo, _mm512_slli_epi64(prod_hi, 32)) |
| const __m256i *const | xsecret = (const __m256i *) secret |
| size_t | i |
| uint32x2_t const | kPrimeLo = vdup_n_u32(XXH_PRIME32_1) |
| uint32x4_t const | kPrimeHi = vreinterpretq_u32_u64(vdupq_n_u64((xxh_u64)XXH_PRIME32_1 << 32)) |
| xxh_u64x2 const | v32 = { 32, 32 } |
| xxh_u64x2 const | v47 = { 47, 47 } |
| xxh_u32x4 const | prime = { XXH_PRIME32_1, XXH_PRIME32_1, XXH_PRIME32_1, XXH_PRIME32_1 } |
| size_t | vl |
| static void const *restrict size_t | lane |
| xxh_u64 | acc64 = xacc[lane] |
| typedef XXH64_hash_t | xxh_u64 |
詳細説明
xxHashの関数プロトタイプと実装。
マクロ定義の説明
◆ XXH_ALIGN
| #define XXH_ALIGN | ( | n | ) |
値:
/* disabled */
◆ XXH_ALIGN_MEMBER
| #define XXH_ALIGN_MEMBER | ( | align, | |
| type ) |
値:
XXH_ALIGN(align) type
◆ XXH3_SECRET_DEFAULT_SIZE
| #define XXH3_SECRET_DEFAULT_SIZE 192 |
既定のシークレットのサイズ。
これは内部のXXH3_kSecretのサイズで、次の関数が必要とします: XXH3_generateSecret_fromSeed()。
混同しないでください: XXH3_SECRET_SIZE_MIN。
◆ XXH3_INITSTATE
| #define XXH3_INITSTATE | ( | XXH3_state_ptr | ) |
値:
do { \
XXH3_state_t* tmp_xxh3_state_ptr = (XXH3_state_ptr); \
tmp_xxh3_state_ptr->seed = 0; \
tmp_xxh3_state_ptr->extSecret = NULL; \
} while(0)
スタックに割り当てたXXH3_state_sを初期化します。
XXH3_state_tを単にスタックに置く場合、最初のresetでXXH3_NNbits_reset_withSeed()を使うなら、次の方法で初期化してください: XXH3_INITSTATE() またはmemset()です。最初のresetがデフォルトまたは_withSecretモードなら、この初期化は省略できます。また、状態を次の関数で作成する場合も不要です: XXH3_createState()。ただし、これだけで状態がストリーミング処理の準備を終えるわけではありません。その後にXXH3_NNbits_reset*()を使う必要があります。
◆ XXH_PROCESS1
| #define XXH_PROCESS1 |
値:
do { \
hash += (*ptr++) * XXH_PRIME32_5; \
hash = XXH_rotl32(hash, 11) * XXH_PRIME32_1; \
} while (0)
◆ XXH_PROCESS4
| #define XXH_PROCESS4 |
値:
do { \
hash += XXH_get32bits(ptr) * XXH_PRIME32_3; \
ptr += 4; \
hash = XXH_rotl32(hash, 17) * XXH_PRIME32_4; \
} while (0)
マクロ値のコメントの日本語訳
コードとコメントは原文を保持しています。コメントの意味は次のとおりです。
YOUR NAME HERE:ここに自分の名前を指定。do nothing:何もしない。disable:無効化。disabled:無効。nothing:何もない。minimum XXH3_SECRET_SIZE_MIN:最小値はXXH3_SECRET_SIZE_MIN。nb of secret bytes consumed at each accumulation:各蓄積処理で消費するシークレットのバイト数。disable attribute target:target属性を無効にする。not aligned on 8, last secret is different from acc & scrambler:8にアライメントしていない。最後のシークレットはアキュムレーターおよびスクランブラー用と異なる。