RELEASE-1.1 #1
8 changed files with 9 additions and 7504 deletions
|
|
@ -224,7 +224,7 @@ std::vector<FilesTable> CreateCargo::ComputingHeadFiles()
|
|||
f.close();
|
||||
|
||||
//Tworzenie hashu CRC
|
||||
uint32_t crc = crc32(buffor);
|
||||
uint64_t crc = XXH64(buffor.data(), buffor.size(), VERSION);
|
||||
|
||||
//Kompresjia
|
||||
std::vector<char> zip;
|
||||
|
|
@ -331,16 +331,6 @@ uint64_t CreateCargo::fnv64(const std::string& data)
|
|||
return hash;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Wygenerój CRC32 HASH integralnoœci
|
||||
//-----------------------------------------------------------------------------
|
||||
uint32_t CreateCargo::crc32(const std::vector<char>& buffer)
|
||||
{
|
||||
boost::crc_32_type crc;
|
||||
crc.process_bytes(buffer.data(), buffer.size());
|
||||
return crc.checksum();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Sprawdzanie czy plik znajduje się na liście
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -30,11 +30,10 @@
|
|||
#include <utility>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <boost/crc.hpp>
|
||||
#include <xxhash.h>
|
||||
|
||||
#include "DataStruct.h"
|
||||
#include "Txtpp.h"
|
||||
#include "xxhash.h"
|
||||
#include "CompressingManager.h"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -32,9 +32,9 @@
|
|||
|
||||
//Prgoram title
|
||||
#define PROGRAM_TITLE "eXtendet PAK"
|
||||
#define PROGRAM_VERSION "v1.0"
|
||||
#define PROGRAM_VERSION "v1.1"
|
||||
#define PROGRAM_AUTHOR "Yanczi"
|
||||
#define PROGRAM_COMPILING "30 September 2025"
|
||||
#define PROGRAM_COMPILING "24 October 2025"
|
||||
#define PROGRAM_LICENSE "GNU LGPL v3"
|
||||
|
||||
//Limity
|
||||
|
|
@ -62,6 +62,6 @@ struct FilesTable
|
|||
uint64_t hashName;
|
||||
uint64_t offset;
|
||||
uint32_t size;
|
||||
uint32_t crc;
|
||||
uint64_t crc;
|
||||
uint8_t isZip;
|
||||
};
|
||||
|
|
@ -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
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -28,10 +28,9 @@
|
|||
#include <sstream>
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <boost/crc.hpp>
|
||||
#include <xxhash.h>
|
||||
|
||||
#include "DataStruct.h"
|
||||
#include "xxhash.h"
|
||||
#include "CompressingManager.h"
|
||||
|
||||
class ExtractCargo {
|
||||
|
|
@ -69,10 +68,7 @@ private:
|
|||
void LoadFilesTable();
|
||||
|
||||
// Sprawdzanie sumy kontrolnej
|
||||
bool HashValid(const std::vector<char>&, const uint32_t&);
|
||||
|
||||
// CRC
|
||||
uint32_t crc32(const std::vector<char>&);
|
||||
bool HashValid(const std::vector<char>&, const uint64_t&);
|
||||
|
||||
// Utwórz katalog
|
||||
void CreateDirections(std::filesystem::path);
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
Boost Software License - Version 1.0 - August 17th, 2003
|
||||
|
||||
Permission is hereby granted, free of charge, to any person or organization
|
||||
obtaining a copy of the software and accompanying documentation covered by
|
||||
this license (the "Software") to use, reproduce, display, distribute,
|
||||
execute, and transmit the Software, and to prepare derivative works of the
|
||||
Software, and to permit third-parties to whom the Software is furnished to
|
||||
do so, all subject to the following:
|
||||
|
||||
The copyright notices in the Software and this entire statement, including
|
||||
the above license grant, this restriction and the following disclaimer,
|
||||
must be included in all copies of the Software, in whole or in part, and
|
||||
all derivative works of the Software, unless such copies or derivative
|
||||
works are solely in the form of machine-executable object code generated by
|
||||
a source language processor.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
|
||||
SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
|
||||
FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
42
xxhash.c
42
xxhash.c
|
|
@ -1,42 +0,0 @@
|
|||
/*
|
||||
* xxHash - Extremely Fast Hash algorithm
|
||||
* Copyright (C) 2012-2023 Yann Collet
|
||||
*
|
||||
* BSD 2-Clause License (https://www.opensource.org/licenses/bsd-license.php)
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions are
|
||||
* met:
|
||||
*
|
||||
* * Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* * Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following disclaimer
|
||||
* in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* You can contact the author at:
|
||||
* - xxHash homepage: https://www.xxhash.com
|
||||
* - xxHash source repository: https://github.com/Cyan4973/xxHash
|
||||
*/
|
||||
|
||||
/*
|
||||
* xxhash.c instantiates functions defined in xxhash.h
|
||||
*/
|
||||
|
||||
#define XXH_STATIC_LINKING_ONLY /* access advanced declarations */
|
||||
#define XXH_IMPLEMENTATION /* access definitions */
|
||||
|
||||
#include "xxhash.h"
|
||||
Loading…
Add table
Add a link
Reference in a new issue