sTodo-m5paper-client/libraries/M5Utility/src/m5_utility/murmurhash3.cpp
2025-06-30 20:47:33 +02:00

24 lines
475 B
C++

/*
* SPDX-FileCopyrightText: 2024 M5Stack Technology CO LTD
*
* SPDX-License-Identifier: MIT
*/
/*!
@file murmurhash3.cpp
@brief MurmurHash3
*/
#include "murmurhash3.hpp"
namespace m5 {
namespace utility {
namespace mmh3 {
uint32_t calculate(const char* str)
{
auto len = strlen(str);
return finalize(rest(str + ((len >> 2) * sizeof(uint32_t)), (len & 3), group_of_4(str, len >> 2)), len);
}
} // namespace mmh3
} // namespace utility
} // namespace m5