SuperMarioOdysseyOnline/include/sead/codec/seadHashCRC32.h

34 lines
807 B
C
Raw Normal View History

2022-06-16 21:33:18 +00:00
#pragma once
#include <basis/seadTypes.h>
#include <prim/seadSafeString.h>
namespace sead
{
class HashCRC32
{
public:
struct Context
{
u32 hash = -1;
};
static u32 calcHash(const void* ptr, u32 size);
static u32 calcHashWithContext(Context* context, const void* ptr, u32 size);
static u32 calcStringHash(const char* str);
static u32 calcStringHash(const SafeString& str) { return calcStringHash(str.cstr()); }
static u32 calcStringHashWithContext(Context* context, const char* str);
static u32 calcStringHashWithContext(Context* context, const SafeString& str)
{
return calcStringHashWithContext(context, str.cstr());
}
static void initialize();
private:
static u32 sTable[256];
static bool sInitialized;
};
} // namespace sead