mirror of
https://github.com/YimMenu/RDR-Classes.git
synced 2024-12-22 22:47:31 +08:00
a2a74e151a
* feat: initialize classes repo * feat(script): stuff for native invoker * feat: add some more classes * feat(player): complete CNetworkPlayerMgr * feat(network): add some more stuff * feat(network): add rlGamerInfo * feat(player): add CPlayerInfo
28 lines
618 B
C++
28 lines
618 B
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <string_view>
|
|
|
|
namespace rage
|
|
{
|
|
using joaat_t = std::uint32_t;
|
|
inline constexpr char joaat_to_lower(char c)
|
|
{
|
|
return c >= 'A' && c <= 'Z' ? c | 1 << 5 : c;
|
|
}
|
|
|
|
inline constexpr joaat_t joaat(const std::string_view str)
|
|
{
|
|
joaat_t hash = 0;
|
|
for (auto c : str)
|
|
{
|
|
hash += joaat_to_lower(c);
|
|
hash += (hash << 10);
|
|
hash ^= (hash >> 6);
|
|
}
|
|
hash += (hash << 3);
|
|
hash ^= (hash >> 11);
|
|
hash += (hash << 15);
|
|
return hash;
|
|
}
|
|
}; |