PJW hash: add credits

This commit is contained in:
2023-01-07 18:16:18 +01:00
parent d0376f21c3
commit 8e00fec33c
3 changed files with 16 additions and 2 deletions

View File

@@ -34,7 +34,7 @@
*
* Return: the PJW hash.
*/
_pjw_inline unsigned int pjwhash(const void* key, uint length)
_pjw_inline uint pjwhash(const void* key, uint length)
{
uint hash = 0, high;
const u8 *k = key;

View File

@@ -15,6 +15,16 @@
#include "bits.h"
extern unsigned int pjwhash (const void* key, uint length)
/**
* unsigned int pjwhash - PJW hash function
* @key: the key address.
* @length: the length of key.
*
* This hash was created by Peter Jay Weinberger (AT&T Bell Labs):
* https://en.wikipedia.org/wiki/PJW_hash_function
*
* Return: the PJW hash.
*/
extern uint pjwhash (const void* key, uint length);
#endif /* _PJWHASH_H */

View File

@@ -13,4 +13,8 @@
#define _pjw_inline extern
//#include "bits.h"
//extern unsigned int pjwhash (const void* key, uint length);
#include "pjwhash.h"
#include "pjwhash-inline.h"