Kawe Mazidjatari 04bee896be Fix string/wstring type conflict
cppkore uses string/wstring as StringBase while we use std::string/std::wstring as string/wstring. Changed all types in cppkore to String/WString instead.
2022-05-21 21:51:35 +02:00

27 lines
790 B
C++

#include "stdafx.h"
#include "XXHash.h"
#include "..\cppkore_incl\LZ4_XXHash\xxhash.h"
#if _WIN64
#pragma comment(lib, "..\\cppkore_libs\\LZ4_XXHash\\liblz4_static_64.lib")
#else
#pragma comment(lib, "..\\cppkore_libs\\LZ4_XXHash\\liblz4_static_32.lib")
#endif
namespace Hashing
{
uint64_t XXHash::HashString(const String& Input, XXHashVersion Version, uint64_t Seed)
{
return ComputeHash((uint8_t*)(char*)Input, 0, Input.Length(), Version, Seed);
}
uint64_t XXHash::ComputeHash(uint8_t* Input, uint64_t InputOffset, uint64_t InputLength, XXHashVersion Version, uint64_t Seed)
{
if (Version == XXHashVersion::XX64)
return XXH64(Input + InputOffset, (size_t)InputLength, (uint64_t)Seed);
else
return XXH32(Input + InputOffset, (size_t)InputLength, (uint32_t)Seed);
}
}