Plasma Engine  2.0
Loading...
Searching...
No Matches
HashHelperString_inl.h
1
2plUInt32 plHashHelperString_NoCase::Hash(plStringView value)
3{
7 const plUInt32 uiElemCount = plStringUtils::ToLowerString(temp.GetData(), temp.GetData() + value.GetElementCount());
8
9 return plHashingUtils::StringHashTo32(plHashingUtils::xxHash64((void*)temp.GetData(), uiElemCount));
10}
11
12bool plHashHelperString_NoCase::Equal(plStringView lhs, plStringView rhs)
13{
14 return lhs.IsEqual_NoCase(rhs);
15}
T * GetData()
Returns a pointer to the array data, or nullptr if the array is empty.
Definition ArrayBase_inl.h:423
void SetCountUninitialized(plUInt32 uiCount)
Resizes the array to have exactly uiCount elements. Extra elements might be uninitialized.
Definition ArrayBase_inl.h:155
static constexpr plUInt32 StringHashTo32(plUInt64 uiHash)
Truncates a 64 bit string hash to 32 bit.
Definition HashingUtils_inl.h:138
static plUInt64 xxHash64(const void *pKey, size_t uiSizeInByte, plUInt64 uiSeed=0)
Calculates the 64bit xxHash of the given key.
Definition HashingUtils.cpp:215
A hybrid array uses in-place storage to handle the first few elements without any allocation....
Definition HybridArray.h:12
static void Copy(T *pDestination, const T *pSource, size_t uiCount=1)
Copies objects of type T from pSource to pDestination.
static plUInt32 ToLowerString(char *szString, const char *pStringEnd=plUnicodeUtils::GetMaxStringEnd< char >())
Converts a (UTF-8) string in-place to lower case.
Definition StringUtils.cpp:176
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
plUInt32 GetElementCount() const
Returns the number of bytes from the start position up to its end.
Definition StringView.h:93
const char * GetStartPointer() const
Returns the start of the view range.
Definition StringView.h:102
bool IsEqual_NoCase(plStringView sOther) const
Compares this string view with the other string view for equality.
Definition StringView_inl.h:95