116 Commits

Author SHA1 Message Date
Timofey Solomko e95c1e3e6e [Common] Mark several enums as Sendable 2026-05-26 11:56:15 +08:00
Timofey Solomko c01d42ff7c [Common] Mark container protocols as Sendable 2026-05-26 11:55:49 +08:00
Timofey Solomko 57186f13af [Common] Add Sendable conformance to OptionSet types 2026-05-26 11:17:37 +08:00
Timofey Solomko e32887084c [Huffman] Change Decoding/Encoding tree to structs
This seems to have a positive impact on the performance of Deflate and BZip2 decompression and compression. It is unclear to me why these two were declared as classes in the first place.
2026-03-01 20:35:22 +08:00
Timofey Solomko d8c22c55da [Deflate][Huffman] Filter out zero code lengths only during code construction
This should prevent crashes described in issue #57.
2026-03-01 20:35:21 +08:00
Timofey Solomko 7f547c20a1 [Huffman] Optimize DecodingTree leaf count 2026-03-01 20:35:21 +08:00
Timofey Solomko 7af76764d7 [BZip2] Use UInt8 arrays instead of Data 2026-02-23 18:08:25 +08:00
Timofey Solomko bff411d511 [BZip2] Improve encoding performance of code lengths deltas 2026-02-23 18:08:25 +08:00
Timofey Solomko 273b6ed9e9 Remove redundant imports 2026-02-18 12:21:57 +08:00
Timofey Solomko 5b5b20f582 [Huffman] Remove codes argument label from EncodingTree.init 2026-02-18 00:12:55 +08:00
Timofey Solomko ce1736a2b0 [Huffman] Add HuffmanCodes typealias for clarity 2026-02-18 00:10:29 +08:00
Timofey Solomko ea9aaccfb9 Update copyright year to 2026 2026-01-31 15:30:24 +08:00
Timofey Solomko ed66991cbd Update copyright year to 2024 2024-01-11 16:57:04 +03:00
Timofey Solomko 43132fc39d Update copyright year to 2023 2023-02-07 15:31:45 +02:00
Timofey Solomko 2b47fb7f49 [Deflate] Replace computation of static tree codes from lenghts with precomputed codes 2022-05-21 23:00:36 +03:00
Timofey Solomko f539a53386 [Huffman] Ensure that there is data available in findNextSymbol()
This fixes potential crashes in BZip2 and Deflate when processing truncated data (a corresponding symbolNotFound error will be thrown instead). There is a performance penalty to this fix, though.
2022-01-20 22:07:43 +03:00
Timofey Solomko 79295db930 Update copyright year to 2022 2022-01-08 15:02:59 +03:00
Timofey Solomko 6971656b63 Two minor changes: make Checksums a caseless enum, fix a grammar mistake in a code comment 2021-11-04 12:10:39 +03:00
Timofey Solomko d73fc791b1 [docs] Add documentation for DataError 2021-11-03 20:19:41 +03:00
Timofey Solomko 7a43328b8e [BZip2] Rename crc32 function for bzip2 2021-10-22 21:55:33 +03:00
Timofey Solomko 490d5ad816 Make DataError conform to Equatable 2021-09-26 14:03:38 +03:00
Timofey Solomko bb39e6e36d Remove DataError.encrypted
I think, this case is covered by DataError.unsupportedFeature, and we don't want redundant cases, since we're trying to minimize the amount of different error types.
2021-09-25 15:50:21 +03:00
Timofey Solomko 3cb6cac20b Add two more cases to DataError 2021-09-24 18:55:31 +03:00
Timofey Solomko 135f4c3bcd Add DataError enum
This enum will be used going forward instead of algorithm-specific error enums.
2021-09-23 21:46:30 +03:00
Timofey Solomko cb8a6738a0 [Common] Change DeltaFilter from final class to enum 2021-07-21 19:47:30 +03:00
Timofey Solomko c19694aa12 Merge branch 'hotfix-4.5.10' into develop 2021-05-23 00:10:17 +03:00
Timofey Solomko 5f7141fd78 Replace Int arrays in EncodingTree with a new CodingIndex struct
The hope is that this will improve memory layout/management, and, consequently, improve performance (slightly).
2021-05-22 23:34:31 +03:00
Timofey Solomko 03d47628a1 Merge branch 'hotfix-4.5.9' into develop 2021-05-01 16:14:33 +03:00
Timofey Solomko f808a8b9b3 [BZip2] Fix a crash on non-standard run length greater than 255 2021-05-01 13:45:02 +03:00
Timofey Solomko 1fca632c2d Update copyright year to 2021 2021-03-26 13:50:20 +02:00
Timofey Solomko e83f23effa Update copyright year to 2021 2021-01-11 11:20:57 +02:00
Timofey Solomko a844b34436 Update copyright year to 2020 2020-03-20 09:43:42 +03:00
Timofey Solomko f6949a8f66 Replace the usage of the deprecated Data(bytes:) initializer 2020-03-20 09:40:48 +03:00
Timofey Solomko 31ec1f1553 Update copyright year to 2020 2020-01-01 19:06:33 +03:00
Timofey Solomko 04b87f9e95 Mark @inline(__always) functions as @inlinable 2019-05-01 19:36:51 +03:00
Timofey Solomko 75b21ae107 Replace usage of ByteReader with LittleEndianByteReader 2019-05-01 19:34:30 +03:00
Timofey Solomko db82490ed8 Replace the usage of the deprecated Data(bytes:) initializer 2019-05-01 19:30:48 +03:00
Timofey Solomko c93a783d21 [docs] Fix grammar issues with regards to a/the/null articles, while/during, and extra commas 2019-03-13 12:27:08 +03:00
Timofey Solomko 04f64bcb72 Rename Encoding/DecodingHuffmanTree to just Encoding/DecodingTree 2019-03-12 22:31:35 +03:00
Timofey Solomko 142fd44dd2 Remove old CodeLength initializer from Encoding(Huffman)Tree 2019-03-12 22:31:24 +03:00
Timofey Solomko 250c9fbd4c Remove old CodeLength initializer from Decoding(Huffman)Tree 2019-03-12 22:31:13 +03:00
Timofey Solomko 5e51968ca6 Add a func which generates Huffman codes based on their lengths 2019-03-12 22:31:02 +03:00
Timofey Solomko 6889f58461 Add new initiliaziers to huffman trees which init from codes instead of lengths 2019-03-12 22:30:50 +03:00
Timofey Solomko 7ae5cfa1a2 Add a new struct which represents an abstract code from coding tree 2019-03-12 22:30:35 +03:00
Timofey Solomko 9f138f86a6 Move Huffman tree related code into the CodingTree sub-group/directory 2019-03-12 22:30:21 +03:00
Timofey Solomko 1df768c09f Move the lengths bootstrapping function into the namespace of the CodeLength 2019-03-12 22:29:53 +03:00
Timofey Solomko 7f25dbf6e7 Rename HuffmanLength to CodeLength 2019-03-12 22:28:01 +03:00
Timofey Solomko 08bea5ad53 Make Huffman tree classes final 2019-01-04 20:22:09 +03:00
Timofey Solomko ce47019097 Update copyright year to 2019 2019-01-02 23:15:43 +03:00
Timofey Solomko 8457f85c75 Add implementation for decoding Delta filter 2018-08-29 10:30:05 +03:00