first commit
This commit is contained in:
commit
5893b00dd2
1669 changed files with 1982740 additions and 0 deletions
24
libraries/M5Utility/src/m5_utility/murmurhash3.cpp
Normal file
24
libraries/M5Utility/src/m5_utility/murmurhash3.cpp
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue