omnizip 0.3.19 → 0.3.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +95 -3
- data/lib/omnizip/version.rb +1 -1
- metadata +1 -3
- data/lib/omnizip/algorithms/sevenzip_lzma2.rb +0 -119
- data/lib/omnizip/algorithms/xz_lzma2.rb +0 -114
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dcad8b150c8f11ed823e029a054b9c7fb8efcd169482dacad067d6a9ea703d3b
|
|
4
|
+
data.tar.gz: af2b5cec7a79078f1068a148c2c7dc128bb1ec4241aef5a6f7c37058eee10adb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3db9493020536b160e63d7519610761f18fb1e77624cb8ebc1ca941bd58be86872e05eafc3985ee53f5767ad84cc095b6013d8a2e25ed3fe22024ba85321b3f0
|
|
7
|
+
data.tar.gz: 83196c0c7630c1cbe05859ca027c7ea5245fcfee56eae2de85e2f7a484c1513d4cc3017885536d22d5fe38fcdcfd84727ed19f313201e7aa3d5190ccc9fe6667
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,100 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [0.3.19] - 2026-08-25
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
- 7-Zip LZMA2 encoder corrupted every chunk after the first: pos_state was
|
|
14
|
+
computed from the chunk-relative position while decoders count positions
|
|
15
|
+
continuously across chunk boundaries. The stale duplicated encoder is now a
|
|
16
|
+
thin subclass of the fixed XZ Utils encoder (also picking up its state-reset,
|
|
17
|
+
64 KiB chunk-cap and symbol-queue fixes).
|
|
18
|
+
|
|
19
|
+
## [0.3.18] - 2026-08-25
|
|
20
|
+
|
|
21
|
+
### Added
|
|
22
|
+
- Zstandard long-distance matching (LDM): a sparse hash table over the whole
|
|
23
|
+
frame finds matches beyond the 128 KiB block window at levels >= 19 for
|
|
24
|
+
multi-block inputs, bringing zstd-22 output to reference parity
|
|
25
|
+
(0.146 vs omnizip-rs 0.1456 on the benchmark corpus).
|
|
26
|
+
|
|
27
|
+
## [0.3.17] - 2026-08-25
|
|
28
|
+
|
|
29
|
+
### Changed
|
|
30
|
+
- Zstandard greedy parser: rep0 fast-path and backward match extension into
|
|
31
|
+
the pending literals (default-level text ratio 0.177 -> 0.167).
|
|
32
|
+
|
|
33
|
+
## [0.3.16] - 2026-08-24
|
|
34
|
+
|
|
35
|
+
### Added
|
|
36
|
+
- Zstandard Compressed_Blocks now carry a sequences section: LZ77 match
|
|
37
|
+
finder (greedy/lazy/lazy2) and LL/OF/ML FSE sequence encoding with
|
|
38
|
+
Predefined/FSE_Compressed table selection. Text ratio 0.49 -> ~0.17.
|
|
39
|
+
|
|
40
|
+
### Changed
|
|
41
|
+
- Migrated ConversionOptions, ParallelOptions, ProgressOptions and EtaResult
|
|
42
|
+
models to lutaml-model (breaking change for hand-rolled hash access).
|
|
43
|
+
|
|
44
|
+
## [0.3.15] - 2026-08-24
|
|
45
|
+
|
|
46
|
+
### Fixed
|
|
47
|
+
- Zstandard codec rebuilt per RFC 8878: FSE tables from stream, FSE Huffman
|
|
48
|
+
weights, treeless literals, repeat mode, XXH64 frame checksums, window
|
|
49
|
+
descriptor; `compress` with default options now really compresses instead
|
|
50
|
+
of emitting stored frames (issues #27, BUGREPORT 01-10).
|
|
51
|
+
- XZ LZMA2 encoder: chunking, repeat-offset state and wire format repaired
|
|
52
|
+
(issue #26; missing `tempfile` require, symbol-buffer overflow at ~10 MB).
|
|
53
|
+
|
|
54
|
+
## [0.3.14] - 2026-07-25
|
|
55
|
+
|
|
56
|
+
### Changed
|
|
57
|
+
- Documented the Algorithms vs Implementations boundary; deepened the
|
|
58
|
+
Algorithm base class with a class-level facade and IO::Source/Sink.
|
|
59
|
+
- Extracted `Omnizip::Parallel::Engine`.
|
|
60
|
+
|
|
61
|
+
## [0.3.13] - 2026-07-24
|
|
62
|
+
|
|
63
|
+
### Changed
|
|
64
|
+
- Reverted the v0.3.12 require-omnizip-everywhere band-aid in favor of
|
|
65
|
+
per-file entry-point requires.
|
|
66
|
+
|
|
67
|
+
## [0.3.12] - 2026-07-24
|
|
68
|
+
|
|
69
|
+
### Fixed
|
|
70
|
+
- Circular dependency at gemspec load (`version.rb` no longer requires
|
|
71
|
+
omnizip); missing entry-point requires at the top of internal files.
|
|
72
|
+
|
|
73
|
+
## [0.3.11] - 2026-07-22
|
|
74
|
+
|
|
75
|
+
### Fixed
|
|
76
|
+
- Format files broke when required directly by external code; LinkHandler
|
|
77
|
+
symlink gating; BCJ filter autoload.
|
|
78
|
+
|
|
79
|
+
## [0.3.10] - 2026-07-21
|
|
80
|
+
|
|
81
|
+
### Changed
|
|
82
|
+
- Migrated CompressionOptions and AlgorithmMetadata to lutaml-model;
|
|
83
|
+
decoupled Convenience from ZIP via ArchiveHandler; replaced `respond_to?`
|
|
84
|
+
type checks with `is_a?`.
|
|
85
|
+
|
|
86
|
+
## [0.3.9] - 2026-03-24
|
|
87
|
+
|
|
88
|
+
### Fixed
|
|
89
|
+
- Windows unrar detection; 7-Zip SDK version validation (major version only).
|
|
90
|
+
|
|
91
|
+
## [0.3.8] - 2026-02-24
|
|
92
|
+
|
|
93
|
+
### Fixed
|
|
94
|
+
- Formats now auto-register when their files are loaded directly.
|
|
95
|
+
|
|
96
|
+
## [0.3.7] - 2026-02-23
|
|
97
|
+
|
|
98
|
+
### Fixed
|
|
99
|
+
- XZ dictionary-size bounds checking (OOM prevention); block header parser
|
|
100
|
+
autoload.
|
|
101
|
+
|
|
8
102
|
## [0.3.6] - 2026-02-23
|
|
9
103
|
|
|
10
104
|
### Changed
|
|
@@ -18,8 +112,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
18
112
|
- Fixed RAR format `verify` and `repair` convenience methods
|
|
19
113
|
- Fixed library loading to ensure convenience methods are available at startup
|
|
20
114
|
|
|
21
|
-
## [Unreleased]
|
|
22
|
-
|
|
23
115
|
### Added
|
|
24
116
|
- **XAR Format Support**: Full read/write support for XAR (eXtensible ARchive) format
|
|
25
117
|
- XAR is primarily used on macOS for software packages (.pkg files) and installers
|
|
@@ -594,4 +686,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
594
686
|
- Native compression support documented
|
|
595
687
|
- All 6 compression methods explained
|
|
596
688
|
- Performance characteristics detailed
|
|
597
|
-
- Real-world usage examples
|
|
689
|
+
- Real-world usage examples
|
data/lib/omnizip/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: omnizip
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.20
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
@@ -298,8 +298,6 @@ files:
|
|
|
298
298
|
- lib/omnizip/algorithms/ppmd8/restoration_method.rb
|
|
299
299
|
- lib/omnizip/algorithms/ppmd_base.rb
|
|
300
300
|
- lib/omnizip/algorithms/registration.rb
|
|
301
|
-
- lib/omnizip/algorithms/sevenzip_lzma2.rb
|
|
302
|
-
- lib/omnizip/algorithms/xz_lzma2.rb
|
|
303
301
|
- lib/omnizip/algorithms/zstandard.rb
|
|
304
302
|
- lib/omnizip/algorithms/zstandard/constants.rb
|
|
305
303
|
- lib/omnizip/algorithms/zstandard/decoder.rb
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# Copyright (C) 2025 Ribose Inc.
|
|
4
|
-
#
|
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a
|
|
6
|
-
# copy of this software and associated documentation files (the "Software"),
|
|
7
|
-
# to deal in the Software without restriction, including without limitation
|
|
8
|
-
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
9
|
-
# and/or sell copies of the Software, and to permit persons to whom the
|
|
10
|
-
# Software is furnished to do so, subject to the following conditions:
|
|
11
|
-
#
|
|
12
|
-
# The above copyright notice and this permission notice shall be included in
|
|
13
|
-
# all copies or substantial portions of the Software.
|
|
14
|
-
#
|
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
20
|
-
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
21
|
-
# DEALINGS IN THE SOFTWARE.
|
|
22
|
-
|
|
23
|
-
module Omnizip
|
|
24
|
-
module Algorithms
|
|
25
|
-
# 7-Zip LZMA2 compression algorithm.
|
|
26
|
-
#
|
|
27
|
-
# This algorithm uses the 7-Zip SDK-compatible implementation of LZMA2,
|
|
28
|
-
# which provides compatibility with 7-Zip command-line tools.
|
|
29
|
-
#
|
|
30
|
-
# @example Compress data
|
|
31
|
-
# algorithm = Omnizip::AlgorithmRegistry.get(:sevenzip_lzma2).new(
|
|
32
|
-
# dict_size: 8 * 1024 * 1024
|
|
33
|
-
# )
|
|
34
|
-
# algorithm.compress(input_io, output_io)
|
|
35
|
-
#
|
|
36
|
-
# @example Decompress data
|
|
37
|
-
# algorithm = Omnizip::AlgorithmRegistry.get(:sevenzip_lzma2).new
|
|
38
|
-
# algorithm.decompress(input_io, output_io)
|
|
39
|
-
class SevenZipLZMA2 < Algorithm
|
|
40
|
-
# Get algorithm metadata.
|
|
41
|
-
#
|
|
42
|
-
# @return [Models::AlgorithmMetadata] Algorithm information
|
|
43
|
-
def self.metadata
|
|
44
|
-
Models::AlgorithmMetadata.new.tap do |meta|
|
|
45
|
-
meta.name = "sevenzip_lzma2"
|
|
46
|
-
meta.description = "LZMA2 compression (7-Zip SDK implementation)"
|
|
47
|
-
meta.version = "1.0.0"
|
|
48
|
-
end
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
# Compress data using 7-Zip LZMA2.
|
|
52
|
-
#
|
|
53
|
-
# @param input [IO, String] Input data
|
|
54
|
-
# @param output [IO] Output stream
|
|
55
|
-
# @return [void]
|
|
56
|
-
def compress(input, output)
|
|
57
|
-
# Apply filter if set
|
|
58
|
-
input_data = if input.is_a?(String)
|
|
59
|
-
if @filter
|
|
60
|
-
@filter.encode(input)
|
|
61
|
-
else
|
|
62
|
-
input
|
|
63
|
-
end
|
|
64
|
-
elsif input.respond_to?(:read)
|
|
65
|
-
data = input.read
|
|
66
|
-
if @filter
|
|
67
|
-
@filter.encode(data)
|
|
68
|
-
else
|
|
69
|
-
data
|
|
70
|
-
end
|
|
71
|
-
else
|
|
72
|
-
raise ArgumentError, "Input must be a String or IO"
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
# Get encoding options
|
|
76
|
-
dict_size = @options.fetch(:dict_size, 8 * 1024 * 1024)
|
|
77
|
-
lc = @options.fetch(:lc, 3)
|
|
78
|
-
lp = @options.fetch(:lp, 0)
|
|
79
|
-
pb = @options.fetch(:pb, 2)
|
|
80
|
-
|
|
81
|
-
# Use existing LZMA2Encoder which wraps SimpleLZMA2Encoder
|
|
82
|
-
encoder = LZMA2::LZMA2Encoder.new(
|
|
83
|
-
dict_size: dict_size,
|
|
84
|
-
lc: lc,
|
|
85
|
-
lp: lp,
|
|
86
|
-
pb: pb,
|
|
87
|
-
standalone: false,
|
|
88
|
-
)
|
|
89
|
-
|
|
90
|
-
compressed = encoder.encode(input_data)
|
|
91
|
-
output.write(compressed)
|
|
92
|
-
end
|
|
93
|
-
|
|
94
|
-
# Decompress data using 7-Zip LZMA2.
|
|
95
|
-
#
|
|
96
|
-
# @param input [IO] Input stream
|
|
97
|
-
# @param output [IO] Output stream
|
|
98
|
-
# @return [void]
|
|
99
|
-
def decompress(input, output)
|
|
100
|
-
dict_size = @options.fetch(:dict_size, 8 * 1024 * 1024)
|
|
101
|
-
|
|
102
|
-
# Use existing LZMA2::Decoder
|
|
103
|
-
decoder = LZMA2::Decoder.new(input, raw_mode: true,
|
|
104
|
-
dict_size: dict_size)
|
|
105
|
-
decompressed = decoder.decode_stream
|
|
106
|
-
|
|
107
|
-
# Reverse filter if set
|
|
108
|
-
if @filter
|
|
109
|
-
decompressed = @filter.decode(decompressed)
|
|
110
|
-
end
|
|
111
|
-
|
|
112
|
-
output.write(decompressed)
|
|
113
|
-
end
|
|
114
|
-
end
|
|
115
|
-
end
|
|
116
|
-
end
|
|
117
|
-
|
|
118
|
-
# Register the algorithm
|
|
119
|
-
Omnizip::Algorithms::SevenZipLZMA2.register_algorithm
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# Copyright (C) 2025 Ribose Inc.
|
|
4
|
-
#
|
|
5
|
-
# Permission is hereby granted, free of charge, to any person obtaining a
|
|
6
|
-
# copy of this software and associated documentation files (the "Software"),
|
|
7
|
-
# to deal in the Software without restriction, including without limitation
|
|
8
|
-
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
9
|
-
# and/or sell copies of the Software, and to permit persons to whom the
|
|
10
|
-
# Software is furnished to do so, subject to the following conditions:
|
|
11
|
-
#
|
|
12
|
-
# The above copyright notice and this permission notice shall be included in
|
|
13
|
-
# all copies or substantial portions of the Software.
|
|
14
|
-
#
|
|
15
|
-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
20
|
-
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
21
|
-
# DEALINGS IN THE SOFTWARE.
|
|
22
|
-
|
|
23
|
-
module Omnizip
|
|
24
|
-
module Algorithms
|
|
25
|
-
# XZ Utils LZMA2 compression algorithm.
|
|
26
|
-
#
|
|
27
|
-
# This algorithm uses the XZ Utils implementation of LZMA2,
|
|
28
|
-
# which provides full compatibility with xz command-line tools.
|
|
29
|
-
#
|
|
30
|
-
# @example Compress data
|
|
31
|
-
# algorithm = Omnizip::AlgorithmRegistry.get(:xz_lzma2).new(
|
|
32
|
-
# dict_size: 8 * 1024 * 1024
|
|
33
|
-
# )
|
|
34
|
-
# algorithm.compress(input_io, output_io)
|
|
35
|
-
#
|
|
36
|
-
# @example Decompress data
|
|
37
|
-
# algorithm = Omnizip::AlgorithmRegistry.get(:xz_lzma2).new
|
|
38
|
-
# algorithm.decompress(input_io, output_io)
|
|
39
|
-
class XZLZMA2 < Algorithm
|
|
40
|
-
# Get algorithm metadata.
|
|
41
|
-
#
|
|
42
|
-
# @return [Models::AlgorithmMetadata] Algorithm information
|
|
43
|
-
def self.metadata
|
|
44
|
-
Models::AlgorithmMetadata.new.tap do |meta|
|
|
45
|
-
meta.name = "xz_lzma2"
|
|
46
|
-
meta.description = "LZMA2 compression (XZ Utils implementation)"
|
|
47
|
-
meta.version = "1.0.0"
|
|
48
|
-
end
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
# Compress data using XZ Utils LZMA2.
|
|
52
|
-
#
|
|
53
|
-
# @param input [IO, String] Input data
|
|
54
|
-
# @param output [IO] Output stream
|
|
55
|
-
# @return [void]
|
|
56
|
-
def compress(input, output)
|
|
57
|
-
input_data = if input.is_a?(String)
|
|
58
|
-
input
|
|
59
|
-
elsif input.respond_to?(:read)
|
|
60
|
-
input.read
|
|
61
|
-
else
|
|
62
|
-
raise ArgumentError, "Input must be a String or IO"
|
|
63
|
-
end
|
|
64
|
-
|
|
65
|
-
# Apply filter if set
|
|
66
|
-
if @filter
|
|
67
|
-
input_data = @filter.encode(input_data)
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
# Get encoding options
|
|
71
|
-
dict_size = @options.fetch(:dict_size, 8 * 1024 * 1024)
|
|
72
|
-
lc = @options.fetch(:lc, 3)
|
|
73
|
-
lp = @options.fetch(:lp, 0)
|
|
74
|
-
pb = @options.fetch(:pb, 2)
|
|
75
|
-
standalone = @options.fetch(:standalone, false)
|
|
76
|
-
|
|
77
|
-
# Create encoder and compress
|
|
78
|
-
encoder = Implementations::XZUtils::LZMA2::Encoder.new(
|
|
79
|
-
dict_size: dict_size,
|
|
80
|
-
lc: lc,
|
|
81
|
-
lp: lp,
|
|
82
|
-
pb: pb,
|
|
83
|
-
standalone: standalone,
|
|
84
|
-
)
|
|
85
|
-
|
|
86
|
-
compressed = encoder.encode(input_data)
|
|
87
|
-
output.write(compressed)
|
|
88
|
-
end
|
|
89
|
-
|
|
90
|
-
# Decompress data using XZ Utils LZMA2.
|
|
91
|
-
#
|
|
92
|
-
# @param input [IO] Input stream
|
|
93
|
-
# @param output [IO] Output stream
|
|
94
|
-
# @return [void]
|
|
95
|
-
def decompress(input, output)
|
|
96
|
-
dict_size = @options.fetch(:dict_size, 8 * 1024 * 1024)
|
|
97
|
-
|
|
98
|
-
decoder = Implementations::XZUtils::LZMA2::Decoder.new(input,
|
|
99
|
-
raw_mode: true, dict_size: dict_size)
|
|
100
|
-
decompressed = decoder.decode_stream
|
|
101
|
-
|
|
102
|
-
# Reverse filter if set
|
|
103
|
-
if @filter
|
|
104
|
-
decompressed = @filter.decode(decompressed)
|
|
105
|
-
end
|
|
106
|
-
|
|
107
|
-
output.write(decompressed)
|
|
108
|
-
end
|
|
109
|
-
end
|
|
110
|
-
end
|
|
111
|
-
end
|
|
112
|
-
|
|
113
|
-
# Register the algorithm
|
|
114
|
-
Omnizip::Algorithms::XZLZMA2.register_algorithm
|