25 #ifndef PXR_BASE_TRACE_STRING_HASH_H
26 #define PXR_BASE_TRACE_STRING_HASH_H
32 PXR_NAMESPACE_OPEN_SCOPE
46 static constexpr std::uint32_t
Hash(
const char (&str)[N]) {
47 return djb2HashStr<N-1>(str);
54 static constexpr std::uint32_t djb2HashStr(
const char* str) {
55 return (djb2HashStr<N-1>(str) * 33) ^ str[N-1];
61 constexpr std::uint32_t TraceStringHash::djb2HashStr<0>(
const char* str) {
65 PXR_NAMESPACE_CLOSE_SCOPE
67 #endif //PXR_BASE_TRACE_STRING_HASH_H
This class provides a function to compute compile time hashes for string literals.
static constexpr std::uint32_t Hash(const char(&str)[N])
Computes a compile time hash of str.