Compare commits

...

12 commits

Author SHA1 Message Date
9593f98ae6 Merge pull request 'streaming' (#14) from streaming into master
Reviewed-on: #14
2025-12-21 11:54:29 +01:00
93296a1f6e Merge pull request 'Strumieniowe pakowanie z podziałem na chunki' (#13) from Wywołanie_i/o into master
Reviewed-on: #13
2025-12-21 09:30:37 +01:00
0ffd302de6 Merge pull request 'Usunięto TUI, Zmieniono strukturę PAK... agan, Rezygnacja z FNV hash jako referencji, Zmieana wartości flag na maski' (#12) from Wywołanie_i/o into master
Reviewed-on: #12
2025-12-21 09:30:08 +01:00
b98ded7ca3 Merge pull request 'Wywołanie_i/o' (#11) from Wywołanie_i/o into master
Reviewed-on: #11
2025-12-15 15:32:34 +01:00
6a07236b2c Merge pull request 'Wywołanie_i/o' (#10) from Wywołanie_i/o into master
Reviewed-on: #10
2025-11-27 15:55:10 +01:00
c63417571a Aktualizuj README.md 2025-11-27 15:48:04 +01:00
1fccdeca2b Merge pull request 'Wywołanie_i/o' (#8) from Wywołanie_i/o into master
Reviewed-on: #8
2025-11-25 18:07:33 +01:00
043c136738 Merge pull request 'Poprawka dla sodium static. DLL nie jest potrzebne' (#7) from Wywołanie_i/o into master
Reviewed-on: #7
2025-11-22 13:25:59 +01:00
e2dc70acc0 Zcalanie ręczne z Wywołanie_i/o 2025-11-20 00:13:09 +01:00
3bf98ba472 Zcalanie ręczne. Jak git nie chce po dobroci to będzie siłą 2025-11-19 22:01:25 +01:00
690e5278c5 Merge pull request 'RELEASE-1.1' (#1) from RELEASE-1.1 into master
Reviewed-on: #1
2025-11-02 03:12:59 +01:00
yanczi
07f25198da Przywrócono xxHash 2025-11-01 23:53:25 +01:00
3 changed files with 31 additions and 93 deletions

View file

@ -1,26 +1,6 @@
/*
* This file is part of VoidArchiveTool.
*
* Copyright (C) 2025 Yanczi
*
* Void Archive Toolis free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "CompressingManager.h"
#include "ChunkManager.h"
ChunkManager::ChunkManager(EncryptionManager& em)
:eman(em)
CompressingManager::CompressingManager()
{ }
ChunkManager::~ChunkManager()
@ -56,17 +36,14 @@ std::vector<char> ChunkManager::chunked(const std::vector<char>& raw, const bool
std::vector<char> outChunk;
// Przetwórz chunki i przetwórz
if (compress)
{
// Zaszyfruj i skompresuj lub tylko skompresuj
outChunk = encrypt ? eman.encrypt(cman.compress(chunk)) : cman.compress(chunk);
}
else
{
// Zaszyfruj lub skopiuj
outChunk = encrypt ? eman.encrypt(chunk) : std::move(chunk);
}
// Buffor wyjœciowy nadpisany skompresowanymi danymi
std::vector<char> zipChunk(maxZipChunkSize);
// Kompresja
int zipSize = LZ4_compress_default(chunk.data(), zipChunk.data(), chunkSize, maxZipChunkSize);
// Zmiana rozmiaru do faktycznego rozmiaru po kompresji
zipChunk.resize(zipSize);
uint32_t chs = static_cast<uint32_t>(chunk.size());
uint32_t zch = static_cast<uint32_t>(outChunk.size());
@ -123,11 +100,19 @@ std::vector<char> ChunkManager::dechunked(const std::vector<char>& zip, const bo
std::memcpy(inChunk.data(), zip.data() + offset, chunkZipSize);
offset += chunkZipSize;
// Jeœli flaga encrypt jest aktywna najpierw zdeszyfruj blok
std::vector<char> zipChunk = encrypt ? eman.decrypt(inChunk) : std::move(inChunk);
// Zdeklarój pusty chunk
std::vector<char> chunk = compress ? cman.decompress(zipChunk, chunkSize) : std::move(zipChunk);
std::vector<char> chunk(chunkSize);
// Dekompresja chunka
int sizeData = LZ4_decompress_safe(zipChunk.data(), chunk.data(), static_cast<int>(chunkZipSize), static_cast<int>(chunkSize));
if (sizeData < 0)
{
throw std::runtime_error("LZ4 Decompressing Error");
}
// Dostosowanie rozmiaru vectora po skompresowaniu
chunk.resize(sizeData);
// Scal chunki
chunksString.insert(chunksString.end(), chunk.begin(), chunk.end());

View file

@ -1,22 +1,3 @@
/*
* This file is part of VoidArchiveTool.
*
* Copyright (C) 2025 Yanczi
*
* Void Archive Toolis free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once
#include <vector>

View file

@ -16,6 +16,8 @@
**Visual Studio 2022**
**CMAKE**
--soon--
**=========================================================================================**
@ -34,7 +36,13 @@
&nbsp; \*\*-c - Packing catalog width compressing all files\*\*
\*\*-p - Packing catalog width out compressing\*\*
\*\*-r - Raw files\*\*
\*\*-c - Compressing\*\*
\*\*-e - Encrypted\*\*
\*\*-s - Compressing and encrypted\*\*
\*\*-f - Packing catalog width unique config for individual files (look on under section)\*\*
@ -47,42 +55,6 @@
**-f Parameters instruction**
**Create regular txt file in same directory on catalog width same name.**
**This is a config file width parameters**
**{COMPRESS} - key for compress files list**
**{COMPRESS}**
**textures/texture.png**
**\*.png**
**{IGNORE} - key for ignoring files list**
**{IGNORE}**
**testfile.odt**
**\*.odt**
**=========================================================================================**
### **Components:**