Linux 커널 v3.19 이상에서 Arch_fast_hash의 대안

Linux 커널 v3.19 이상에서 Arch_fast_hash의 대안

주어진 버퍼의 해시 값을 찾기 위해 에 선언되고 정의된 arch_fast_hashLinux 커널 v3.16에 있는 함수를 사용했습니다 .include/linux/hash.hlinux/lib/hash.c

그러나 Linux 커널 v3.19에서는 해당 기능이 사라졌습니다. 새로운 기능과 매크로가 거의 없지만 적절한 문서가 없습니다.

arch_fast_hash적절한 해싱 기술이나 v3.19 의 대안이 무엇인지 알려주세요 .

또한 해시에 대한 더 빠른 대안이 있습니까?

연결

Linux 커널 v3.16의 include/linux/hash.h
Linux 커널 v3.19의 include/linux/hash.h

답변1

노력하다:

#include <linux/jhash.h>

이 기능을 사용하십시오 :

/* 
* jhash - hash an arbitrary key
* @k: sequence of bytes as key
* @length: the length of the key
* @initval: the previous hash, or an arbitray value
* 
* The generic version, hashes an arbitrary sequence of bytes. 
* No alignment or length assumptions are made about the input key.
* Returns the hash value of the key. The result depends on endianness.
*/

u32 jhash(const void *key, u32 length, u32 initval);

관련 정보