From 6392aa83c4f895ebbd23817c68d9b0da0de2e0f8 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Fri, 27 Aug 2010 14:11:14 -0700 Subject: lib: Better hashing of string values using Bernstein hash * hash.{h,c}: (string_hash_make) Hash optimised for strings, current implementation using Bernstein hash, which offers a good compromise between distribution and performance. * distribute.c: (distribute_hash_make) use previous instead of additive string hash. * if_rmap.c: (if_rmap_hash_make) ditto --- lib/hash.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/hash.h') diff --git a/lib/hash.h b/lib/hash.h index f4b1c23e..4cb772e5 100644 --- a/lib/hash.h +++ b/lib/hash.h @@ -70,4 +70,6 @@ extern void hash_iterate (struct hash *, extern void hash_clean (struct hash *, void (*) (void *)); extern void hash_free (struct hash *); +extern unsigned int string_hash_make (const char *); + #endif /* _ZEBRA_HASH_H */ -- cgit v1.2.1