diff --git a/lib/hash-pjw.c b/lib/hash-pjw.c index 0966598..8ee7c27 100644 --- a/lib/hash-pjw.c +++ b/lib/hash-pjw.c @@ -38,3 +38,15 @@ hash_pjw (const void *x, size_t tablesize) return h % tablesize; } + +size_t +hash_pjw_s (const void *x, size_t x_size, size_t tablesize) +{ + const unsigned char *s; + size_t i, h = 0; + + for (i=0; i> (SIZE_BITS - 9))); + + return h % tablesize; +} diff --git a/lib/hash-pjw.h b/lib/hash-pjw.h index 6404916..5d39877 100644 --- a/lib/hash-pjw.h +++ b/lib/hash-pjw.h @@ -21,3 +21,4 @@ The result is platform dependent: it depends on the size of the 'size_t' type and on the signedness of the 'char' type. */ extern size_t hash_pjw (void const *x, size_t tablesize) _GL_ATTRIBUTE_PURE; +extern size_t hash_pjw_s (void const *x, size_t x_size, size_t tablesize) _GL_ATTRIBUTE_PURE;