Files
GabsPuNs-Project_Zenith_Main/Minecraft.World/Hasher.cpp
GabsPuNs 3ee643962d Fix compilation for MSVC, also moved some folders.
1. Added again the libraries for MSVC. If you need MinGW libraries version tell me
2. Removed "#include stdafx.h". Is not needed.
3. Renamed "RmlUIAssets" to "UI" and "Menus" to "Iggy"
2026-06-10 21:22:41 -04:00

27 lines
607 B
C++

#include <functional>
#include "Hasher.h"
Hasher::Hasher(wstring &salt)
{
this->salt = salt;
}
wstring Hasher::getHash(wstring &name)
{
// 4J Stu - Removed try/catch
//try {
wstring s = wstring( salt ).append( name );
//MessageDigest m;
//m = MessageDigest.getInstance("MD5");
//m.update(s.getBytes(), 0, s.length());
//return new BigInteger(1, m.digest()).toString(16);
// TODO 4J Stu - Will this hash us with the same distribution as the MD5?
return std::to_wstring(std::hash<wstring>{}( s ) );
//}
//catch (NoSuchAlgorithmException e)
//{
// throw new RuntimeException(e);
//}
}