Bash 2022 day 12 (parts 1 & 2), before cleaning code
This commit is contained in:
@@ -24,6 +24,16 @@
|
||||
#define _pjw_inline static inline
|
||||
#endif
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
_pjw_inline unsigned int pjwhash(const void* key, uint length)
|
||||
{
|
||||
uint hash = 0, high;
|
||||
|
Reference in New Issue
Block a user