Add Murmur2A hashing feature to BLI
authorBastien Montagne <montagne29@wanadoo.fr>
Fri, 14 Nov 2014 10:00:10 +0000 (11:00 +0100)
committerBastien Montagne <montagne29@wanadoo.fr>
Fri, 14 Nov 2014 10:00:26 +0000 (11:00 +0100)
commit64c0c13e6e08c51e92504631468db864f553d9b5
tree5903262689a45defda7a98782656964bdaa50f6b
parentc8a9764987a8c1e7ea0093e8a0b028a65af6ee33
Add Murmur2A hashing feature to BLI

Murmur2a is a very fast hashing function generation int32 hashes.
It also features a very good distribution of generated hashes.

However, it is not endianness-agnostic, meaning it will usually generate
different hashes for a same key on big- and little-endian architectures.
Consequently, **it shall not be used to generate persistent hashes**
(never store them in .blend file e.g.).

This implementation supports incremental hashing, and is a direct
adaptation of reference implementation (in c++):
https://smhasher.googlecode.com/svn-history/r130/trunk/MurmurHash2.cpp

That cpp code was also used to generate reference values in gtests file.

Reviewers: sergey, campbellbarton

Reviewed By: campbellbarton

Projects: #bf_blender

Differential Revision: https://developer.blender.org/D892
source/blender/blenlib/BLI_hash_md5.h [moved from source/blender/blenlib/BLI_md5.h with 95% similarity]
source/blender/blenlib/BLI_hash_mm2a.h [new file with mode: 0644]
source/blender/blenlib/CMakeLists.txt
source/blender/blenlib/intern/hash_md5.c [moved from source/blender/blenlib/intern/md5.c with 99% similarity]
source/blender/blenlib/intern/hash_mm2a.c [new file with mode: 0644]
source/blender/imbuf/intern/thumbs.c
source/blender/render/intern/source/render_result.c
tests/gtests/blenlib/BLI_hash_mm2a_test.cc [new file with mode: 0644]
tests/gtests/blenlib/CMakeLists.txt