]> dgit.raspbian.org Git - dovecot.git/commitdiff
[PATCH 03/12] lib: Add str_stable_hash()
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 13 Apr 2026 15:20:46 +0000 (17:20 +0200)
committerNoah Meyerhans <noahm@debian.org>
Wed, 16 Sep 2026 19:06:35 +0000 (15:06 -0400)
For now this is the same as str_hash(), but this is changed in a following
commit.

Gbp-Pq: Name 0003-lib-Add-str_stable_hash.patch

src/lib/hash.c
src/lib/hash.h

index 8f4cd7d9b41b371d005b53c2172611ee8afdd723..61fe86ed8e84835e50c42871d2f8eacc977a3052 100644 (file)
@@ -525,6 +525,11 @@ unsigned int str_hash(const char *p)
        return xxh64_to_32(xxh64_data(p, strlen(p), 0));
 }
 
+unsigned int str_stable_hash(const char *p)
+{
+       return xxh64_to_32(xxh64_data(p, strlen(p), 0));
+}
+
 unsigned int strcase_hash(const char *p)
 {
        struct xxh64_context ctx;
index 5716a77a7dbb7a950d7dd5d767b0eb8e10ab577b..84d9c52aefa1a97e9fd1e20d38948f6346282bd8 100644 (file)
@@ -171,6 +171,7 @@ void hash_table_copy(struct hash_table *dest, struct hash_table *src);
 /* hash function for strings */
 unsigned int str_hash(const char *p) ATTR_PURE;
 unsigned int strcase_hash(const char *p) ATTR_PURE;
+unsigned int str_stable_hash(const char *p) ATTR_PURE;
 
 /* fast hash function which uppercases a-z. Does not work well
    with input that consists from non number/letter input, as