first commit
This commit is contained in:
28
Minecraft.World/Hasher.cpp
Normal file
28
Minecraft.World/Hasher.cpp
Normal file
@@ -0,0 +1,28 @@
|
||||
#include "stdafx.h"
|
||||
#include <xhash>
|
||||
|
||||
#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 _toString( hash_value( s ) );
|
||||
//}
|
||||
//catch (NoSuchAlgorithmException e)
|
||||
//{
|
||||
// throw new RuntimeException(e);
|
||||
//}
|
||||
}
|
||||
Reference in New Issue
Block a user