Out of curiosity I thought that the bit mixing function of bcd32 might
also perform greatly inside a hash function. So I like to propose such a versatile hash calculator build around my 32bit PRNG bcd32. It can
generate any hash with a size of a multiple of 32bit like
32/64/96/128/160 ... and so on.
It passes all extensive tests for distribution, collision, and
performance conducted with the SMHasher test battery made by Austin
Appleby, author of the MurmurHash.
https://github.com/aappleby/smhasher
The source code including compile instructions and test vectors is
located for download on my server at
http://www.freecx.co.uk/bcd32/bcd32_hash/
The SMHasher test results are available here
http://www.freecx.co.uk/bcd32/bcd32_hash/Test_Results/
If you like to run your own tests on bcd32_hash with SMHasher in order
to verify my published results you need either to modify the following
source code files accordingly or download the prepared files from here
http://www.freecx.co.uk/bcd32/bcd32_hash/smhasher_bcd32/
https://github.com/aappleby/smhasher/blob/master/src/Hashes.h
Add
------8<-----------------------------------------------------
[...]
void bcd32_hash( const void * key, int len, uint32_t seed, void * out,
int byte_size );
inline void bcd32_32(const void *key, int len, uint32_t seed, void *out) {
bcd32_hash(key, len, seed, out, 4);
}
inline void bcd32_64(const void *key, int len, uint32_t seed, void *out) {
bcd32_hash(key, len, seed, out, 8);
}
inline void bcd32_128(const void *key, int len, uint32_t seed, void *out) {
bcd32_hash(key, len, seed, out, 16);
}
inline void bcd32_256(const void *key, int len, uint32_t seed, void *out) {
bcd32_hash(key, len, seed, out, 32);
}
[...]
------8<-----------------------------------------------------
https://github.com/aappleby/smhasher/blob/master/src/main.cpp
Add
------8<-----------------------------------------------------
[...]
{ bcd32_32, 32, 0x00000000, "bcd32_32bit", " 32 bit hash result" },
{ bcd32_64, 64, 0x00000000, "bcd32_64bit", " 64 bit hash result" },
{ bcd32_128, 128, 0x00000000, "bcd32_128bit", "128 bit hash result" },
{ bcd32_256, 256, 0x00000000, "bcd32_256bit", "256 bit hash result" },
[...]
------8<-----------------------------------------------------
https://github.com/aappleby/smhasher/blob/master/src/CMakeLists.txt
Add
------8<-----------------------------------------------------
[...]
add_library(
[...]
bcd32_hash.cpp
)
[...]
------8<-----------------------------------------------------
Comments and critique is always welcome.
Cheers,
Karl-Uwe
--
cHNiMUBACG0HAAAAAAAAAAAAAABIZVbDdKVM0w1kM9vxQHw+bkLxsY/Z0czY0uv8/Ks6WULxJVua zjvpoYvtEwDVhP7RGTCBVlzZ+VBWPHg5rqmKWvtzsuVmMSDxAIS6Db6YhtzT+RStzoG9ForBcG8k G97Q3Jml/aBun8Kyf+XOBHpl5gNW4YqhiM0=
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)