aboutsummaryrefslogtreecommitdiff
path: root/bloom.h
diff options
context:
space:
mode:
authorLidong Yan <yldhome2d2@gmail.com>2025-07-12 17:35:13 +0800
committerJunio C Hamano <gitster@pobox.com>2025-07-14 10:03:02 -0700
commit4ca70179020b6a33bb5334302e7c79faf7eeaf52 (patch)
tree198f5b0b491055cf3595e3f49671f4e230d71d54 /bloom.h
parent16bd9f20a403117f2e0d9bcda6c6e621d3763e77 (diff)
downloadgit-4ca70179020b6a33bb5334302e7c79faf7eeaf52.tar.xz
bloom: add test helper to return murmur3 hash
In bloom.h, murmur3_seeded_v2() is exported for the use of test murmur3 hash. To clarify that murmur3_seeded_v2() is exported solely for testing purposes, a new helper function test_murmur3_seeded() was added instead of exporting murmur3_seeded_v2() directly. Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'bloom.h')
-rw-r--r--bloom.h12
1 files changed, 3 insertions, 9 deletions
diff --git a/bloom.h b/bloom.h
index 6e46489a20..a9ded1822f 100644
--- a/bloom.h
+++ b/bloom.h
@@ -78,15 +78,6 @@ int load_bloom_filter_from_graph(struct commit_graph *g,
struct bloom_filter *filter,
uint32_t graph_pos);
-/*
- * Calculate the murmur3 32-bit hash value for the given data
- * using the given seed.
- * Produces a uniformly distributed hash value.
- * Not considered to be cryptographically secure.
- * Implemented as described in https://en.wikipedia.org/wiki/MurmurHash#Algorithm
- */
-uint32_t murmur3_seeded_v2(uint32_t seed, const char *data, size_t len);
-
void fill_bloom_key(const char *data,
size_t len,
struct bloom_key *key,
@@ -137,4 +128,7 @@ int bloom_filter_contains(const struct bloom_filter *filter,
const struct bloom_key *key,
const struct bloom_filter_settings *settings);
+uint32_t test_bloom_murmur3_seeded(uint32_t seed, const char *data, size_t len,
+ int version);
+
#endif