Skip to content

Instantly share code, notes, and snippets.

Lee Lee-R

Block or report user

Report or block Lee-R

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Lee-R
Lee-R / lithash.cpp
Created Oct 5, 2012
C++11 compile-time hash of literal strings.
View lithash.cpp
#include <cstdint>
namespace detail
{
// FNV-1a 32bit hashing algorithm.
constexpr std::uint32_t fnv1a_32(char const* s, std::size_t count)
{
return ((count ? fnv1a_32(s, count - 1) : 2166136261u) ^ s[count]) * 16777619u;
}
} // namespace detail
You can’t perform that action at this time.