Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sztomi/constexpr_murmurhash
This is a constexpr implementation of the Murmur3A hash function.
https://github.com/sztomi/constexpr_murmurhash
Last synced: 15 days ago
JSON representation
This is a constexpr implementation of the Murmur3A hash function.
- Host: GitHub
- URL: https://github.com/sztomi/constexpr_murmurhash
- Owner: sztomi
- Created: 2015-10-11T21:08:13.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-10-14T19:33:06.000Z (about 9 years ago)
- Last Synced: 2024-08-01T15:06:03.392Z (3 months ago)
- Language: C++
- Size: 110 KB
- Stars: 27
- Watchers: 3
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# A `constexpr` Murmur3A hash
This is a constexpr (C++14) implementation or MurMur3A which can be compiled
with clang or gcc. For more details, see my
[blog post](http://szelei.me/constexpr-murmurhash) about this library.# Usage
This is a header-only library. Include the header `constexpr_murmur3.h` and call
the function `ce_mm3::mm3_x86_32`.# Is the value returned really a compile-time constant?
Yes. The following code would not compile otherwise:
```cpp
using ce_mm3::mm3_x86_32;template
struct printer
{
printer() { std::cout << N << std::endl; }
};printer p;
```# Is this code well-formed according to the standard?
To be honest, I'm not entirely sure. I am not using any `reinterpret_cast`s which
would be the main culprit in implementing hash functions that deal operate on
blocks of data. Feel free to comment on my
[post](http://szelei.me/constexpr-murmurhash) if you have any input on the issue.