mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-21 21:17:25 +00:00
remove md5 new
tested that sqlite hash is still calculated
This commit is contained in:
parent
35c463656d
commit
6943e2048f
@ -282,24 +282,22 @@ int main(int argc, char** argv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const int32_t bufferSize = 1024;
|
const int32_t bufferSize = 1024;
|
||||||
MD5* md5 = new MD5();
|
MD5 md5;
|
||||||
|
|
||||||
char fileStreamBuffer[1024] = {};
|
char fileStreamBuffer[1024] = {};
|
||||||
|
|
||||||
while (!fileStream.eof()) {
|
while (!fileStream.eof()) {
|
||||||
memset(fileStreamBuffer, 0, bufferSize);
|
memset(fileStreamBuffer, 0, bufferSize);
|
||||||
fileStream.read(fileStreamBuffer, bufferSize);
|
fileStream.read(fileStreamBuffer, bufferSize);
|
||||||
md5->update(fileStreamBuffer, fileStream.gcount());
|
md5.update(fileStreamBuffer, fileStream.gcount());
|
||||||
}
|
}
|
||||||
|
|
||||||
fileStream.close();
|
fileStream.close();
|
||||||
|
|
||||||
const char* nullTerminateBuffer = "\0";
|
const char* nullTerminateBuffer = "\0";
|
||||||
md5->update(nullTerminateBuffer, 1); // null terminate the data
|
md5.update(nullTerminateBuffer, 1); // null terminate the data
|
||||||
md5->finalize();
|
md5.finalize();
|
||||||
databaseChecksum = md5->hexdigest();
|
databaseChecksum = md5.hexdigest();
|
||||||
|
|
||||||
delete md5;
|
|
||||||
|
|
||||||
LOG("FDB Checksum calculated as: %s", databaseChecksum.c_str());
|
LOG("FDB Checksum calculated as: %s", databaseChecksum.c_str());
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user