Delete CRC. Przywrucono xxHash z pakietu LZ4. Dodano wstępną funkcję henerowania pliku HPP z kluczem i nonce.
This commit is contained in:
parent
a0a2f3e1d6
commit
967e1e9c13
12 changed files with 66 additions and 83 deletions
|
|
@ -114,9 +114,9 @@ bool ExtractCargo::CheckCargoFile()
|
|||
//-----------------------------------------------------------------------------
|
||||
// Sprawdzanie sumy kontrolnej
|
||||
//-----------------------------------------------------------------------------
|
||||
bool ExtractCargo::HashValid(const std::vector<char>& data, const uint32_t& crc)
|
||||
bool ExtractCargo::HashValid(const std::vector<char>& data, const uint64_t& crc)
|
||||
{
|
||||
uint32_t actualCrc = crc32(data);
|
||||
uint64_t actualCrc = XXH64(data.data(), data.size(), VERSION);
|
||||
|
||||
if (actualCrc != crc)
|
||||
{
|
||||
|
|
@ -126,16 +126,6 @@ bool ExtractCargo::HashValid(const std::vector<char>& data, const uint32_t& crc)
|
|||
return true;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Wygenerój CRC32 HASH integralnoœci
|
||||
//-----------------------------------------------------------------------------
|
||||
uint32_t ExtractCargo::crc32(const std::vector<char>& buffer)
|
||||
{
|
||||
boost::crc_32_type crc;
|
||||
crc.process_bytes(buffer.data(), buffer.size());
|
||||
return crc.checksum();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Pobieranie nagłówków plików
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue