fate-extra / xxhash

Automatically exported from code.google.com/p/xxhash
Other
0 stars 0 forks source link

Add a version of xxh which produces a hash of 0 when hashing NULL input #26

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Add a version of xxh which produces a hash of 0 when hashing NULL input

Requested by Alexios Zavras

Original issue reported on code.google.com by yann.col...@gmail.com on 17 Feb 2015 at 12:42

GoogleCodeExporter commented 8 years ago
This would produce a behavior difference with current version of xxHash, where 
xxh(null ptr) == xxh(valid Ptr, size=0).

I recommend an external switch, such as :

xxh0(const void* ptr, ...) { if (ptr==NULL) return 0; return xxh(ptr, ...); }

Original comment by yann.col...@gmail.com on 13 Aug 2015 at 11:59

GoogleCodeExporter commented 8 years ago

Original comment by yann.col...@gmail.com on 13 Aug 2015 at 12:00