Rework hashes (also fix Fletcher16 and CRC64)

This commit is contained in:
Jérôme Leclercq
2022-02-10 01:46:58 +01:00
parent 52100e3b3b
commit 97ee89afb7
29 changed files with 1262 additions and 1330 deletions

View File

@@ -424,10 +424,8 @@ namespace Nz
* \remark Produces a NazaraError if file could not be read
*/
NAZARA_CORE_API bool HashAppend(AbstractHash* hash, const File& originalFile)
NAZARA_CORE_API bool HashAppend(AbstractHash& hash, const File& originalFile)
{
NazaraAssert(hash, "Invalid hash");
File file(originalFile.GetPath());
if (!file.Open(OpenMode::ReadOnly))
{
@@ -448,7 +446,7 @@ namespace Nz
}
remainingSize -= size;
hash->Append(reinterpret_cast<UInt8*>(&buffer[0]), size);
hash.Append(reinterpret_cast<UInt8*>(&buffer[0]), size);
}
return true;