commit_hash
stringlengths
40
40
author
stringlengths
1
57
date
timestamp[s]date
2010-07-26 04:45:09
2026-04-14 18:21:10
message
stringlengths
8
1.39M
diff
stringlengths
68
51.2k
files_changed
int64
1
136
insertions
int64
0
2.35k
deletions
int64
0
1.9k
fb92a10a916ca65f22012496a189345e719ccaf3
Moritz Borcherding
2025-05-03T14:44:27
make clippy happy
diff --git a/benches/decode_all.rs b/benches/decode_all.rs index 4631139..4399867 100644 --- a/benches/decode_all.rs +++ b/benches/decode_all.rs @@ -3,7 +3,7 @@ use ruzstd::decoding::FrameDecoder; fn criterion_benchmark(c: &mut Criterion) { let mut fr = FrameDecoder::new(); - let mut target_slice = &mut vec!...
10
106
162
c51eda1c8fd60a4acf28d4fbfb12f0657bd25bc9
Moritz Borcherding
2025-05-03T14:01:32
bump to 0.8.1
diff --git a/Cargo.toml b/Cargo.toml index e45c2b3..884b835 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ruzstd" -version = "0.8.0" +version = "0.8.1" authors = ["Moritz Borcherding <moritz.borcherding@web.de>"] edition = "2018" license = "MIT"
1
1
1
298300a6c92d04e5fe77d5a9a80a8639ecafb8fb
Moritz Borcherding
2025-04-21T17:41:51
implement checks in zstd compression binary
diff --git a/src/bin/zstd.rs b/src/bin/zstd.rs index bdd80bd..1364452 100644 --- a/src/bin/zstd.rs +++ b/src/bin/zstd.rs @@ -185,6 +185,20 @@ fn main() { }, start_instant.elapsed().as_millis() ); + + println!("Check against source file. Decoding..."); + ...
1
14
0
30890e0bb197e42a6c19c88ddc61e6a0ff426fec
Moritz Borcherding
2025-04-21T17:07:23
improve fse table generation which makes it worth it to enable using a new table for each block
diff --git a/src/encoding/blocks/compressed.rs b/src/encoding/blocks/compressed.rs index 02a0471..85593e1 100644 --- a/src/encoding/blocks/compressed.rs +++ b/src/encoding/blocks/compressed.rs @@ -122,7 +122,7 @@ fn choose_table<'a>( max_log: u8, ) -> FseTableMode<'a> { // TODO check if the new table is bett...
2
13
2
dfdc5ba4c864c145f83128c7507a440e2ea0d59f
Moritz Borcherding
2025-04-21T16:18:42
fse table building only needs to process symbols that are actually present
diff --git a/src/fse/fse_encoder.rs b/src/fse/fse_encoder.rs index 53762e3..7826de1 100644 --- a/src/fse/fse_encoder.rs +++ b/src/fse/fse_encoder.rs @@ -198,7 +198,6 @@ pub(super) struct SymbolStates { impl SymbolStates { fn get(&self, idx: usize, max_idx: usize) -> &State { let start_search_at = (idx * ...
1
10
3
0882961eadf67b2efa6131695df51a7883b5cbbb
Moritz Borcherding
2025-04-21T12:56:03
implement storing the previously used fse table
diff --git a/src/encoding/blocks/compressed.rs b/src/encoding/blocks/compressed.rs index 2e0ef1a..02a0471 100644 --- a/src/encoding/blocks/compressed.rs +++ b/src/encoding/blocks/compressed.rs @@ -51,60 +51,66 @@ pub fn compress_block<M: Matcher>(state: &mut CompressState<M>, output: &mut Vec // Choose the t...
1
47
50
718f09fed030deb6b108e0253ca6c6e0fd2cbb6c
Moritz Borcherding
2025-04-21T12:05:46
more preparation for comparing tables
diff --git a/src/encoding/blocks/compressed.rs b/src/encoding/blocks/compressed.rs index 9a072cc..2e0ef1a 100644 --- a/src/encoding/blocks/compressed.rs +++ b/src/encoding/blocks/compressed.rs @@ -4,7 +4,7 @@ use crate::{ bit_io::BitWriter, encoding::frame_compressor::CompressState, encoding::{Matcher, S...
1
22
12
fd7fc5b2c065d76fa58eb86f5a6f09c742ed28d5
Moritz Borcherding
2025-04-21T11:29:48
switch from std::borrow::Cow to own implementation, Cow is not present in core
diff --git a/src/encoding/blocks/compressed.rs b/src/encoding/blocks/compressed.rs index 76e74db..9a072cc 100644 --- a/src/encoding/blocks/compressed.rs +++ b/src/encoding/blocks/compressed.rs @@ -72,11 +72,17 @@ pub fn compress_block<M: Matcher>(state: &mut CompressState<M>, output: &mut Vec writer.write_bi...
1
29
7
8292ba662e2cbd7b7fd777336d62be3ee3d7262a
Moritz Borcherding
2025-04-21T11:20:44
only calculate default tables once and prepare for storing previously used fse tables
diff --git a/src/encoding/blocks/compressed.rs b/src/encoding/blocks/compressed.rs index 571e05b..76e74db 100644 --- a/src/encoding/blocks/compressed.rs +++ b/src/encoding/blocks/compressed.rs @@ -4,7 +4,7 @@ use crate::{ bit_io::BitWriter, encoding::frame_compressor::CompressState, encoding::{Matcher, S...
2
35
14
f57b0c2e19d2f675f0c5e0d1988ceab7c4200d17
Moritz Borcherding
2025-04-21T10:46:37
preparations for building fse tables from sequences instead of only using the predefined tables
diff --git a/src/encoding/blocks/compressed.rs b/src/encoding/blocks/compressed.rs index 590b21b..571e05b 100644 --- a/src/encoding/blocks/compressed.rs +++ b/src/encoding/blocks/compressed.rs @@ -50,14 +50,29 @@ pub fn compress_block<M: Matcher>(state: &mut CompressState<M>, output: &mut Vec encode_seqnum(seq...
4
62
27
ad1679cdeb3d0df9aa80b29ed42fdd9ce3392064
Moritz Borcherding
2025-04-21T09:59:54
encode fse tables for sequences
diff --git a/src/encoding/blocks/compressed.rs b/src/encoding/blocks/compressed.rs index d9b11ba..590b21b 100644 --- a/src/encoding/blocks/compressed.rs +++ b/src/encoding/blocks/compressed.rs @@ -61,11 +61,16 @@ pub fn compress_block<M: Matcher>(state: &mut CompressState<M>, output: &mut Vec writer.write_bi...
2
56
33
26a2e01b098410baaceb88b132368a1046401496
Moritz Borcherding
2025-04-21T09:44:16
encode mode of fse tables
diff --git a/src/encoding/blocks/compressed.rs b/src/encoding/blocks/compressed.rs index c880602..d9b11ba 100644 --- a/src/encoding/blocks/compressed.rs +++ b/src/encoding/blocks/compressed.rs @@ -49,18 +49,42 @@ pub fn compress_block<M: Matcher>(state: &mut CompressState<M>, output: &mut Vec } else { enc...
1
27
3
5304729d1fb92ce5f26c1f4dd2d2b8f177f9cbc2
Moritz Borcherding
2025-04-21T09:34:54
factor out encoding sequences using any fse table
diff --git a/src/encoding/blocks/compressed.rs b/src/encoding/blocks/compressed.rs index 7cf956c..c880602 100644 --- a/src/encoding/blocks/compressed.rs +++ b/src/encoding/blocks/compressed.rs @@ -56,62 +56,72 @@ pub fn compress_block<M: Matcher>(state: &mut CompressState<M>, output: &mut Vec let ml_table: FSE...
1
58
48
f55fed9eee15acac9e605c30dcb8be3a2bd6b572
zleyyij
2025-04-12T10:44:10
refactor: move compress_fastest to a new file (#87) Co-authored-by: arc <zleyyij@users.noreply.github.com>
diff --git a/src/encoding/frame_compressor.rs b/src/encoding/frame_compressor.rs index fe7265a..727f917 100644 --- a/src/encoding/frame_compressor.rs +++ b/src/encoding/frame_compressor.rs @@ -9,14 +9,11 @@ use twox_hash::XxHash64; use core::hash::Hasher; use super::{ - block_header::BlockHeader, blocks::compres...
4
82
47
c62c0801465255b496a3897cd1385d4a5faa6385
zleyyij
2025-03-29T14:11:00
Some cleanup of the internal structure
diff --git a/src/decoding/frame.rs b/src/decoding/frame.rs index 1cec485..263cab5 100644 --- a/src/decoding/frame.rs +++ b/src/decoding/frame.rs @@ -3,7 +3,7 @@ use crate::decoding::errors::{FrameDescriptorError, FrameHeaderError, ReadFrameH use crate::io::Read; /// Read a single serialized frame from the reader an...
5
114
133
acc59f59effdcdddc2660af60d6e54e70da4a533
zleyyij
2025-03-16T12:41:44
Move bitwriter/reader into common module and consolidate/cleanup constants
diff --git a/src/decoding/bit_reader.rs b/src/bit_io/bit_reader.rs similarity index 92% rename from src/decoding/bit_reader.rs rename to src/bit_io/bit_reader.rs index 2fba6db..4e88948 100644 --- a/src/decoding/bit_reader.rs +++ b/src/bit_io/bit_reader.rs @@ -1,41 +1,10 @@ -use super::errors::GetBitsError; - -/// Inter...
29
209
181
805dfc5ef18620a16df7a3540eace3845c6a05d8
Moritz Borcherding
2025-02-27T18:21:18
fix #83 it's allowed to encode zero number_sequences with the two byte format even if it's wasteful
diff --git a/src/blocks/sequence_section.rs b/src/blocks/sequence_section.rs index 8d871fa..0ecd311 100644 --- a/src/blocks/sequence_section.rs +++ b/src/blocks/sequence_section.rs @@ -114,10 +114,10 @@ impl SequencesHeader { }); } - let source = match source[0] { + match source[0]...
1
19
13
48ac3e47dbe9dd1f519d253a6ebce79f89c7c97d
Moritz Borcherding
2025-02-10T19:45:55
make clippy happy
diff --git a/benches/decode_all.rs b/benches/decode_all.rs index e7f89cd..4631139 100644 --- a/benches/decode_all.rs +++ b/benches/decode_all.rs @@ -8,7 +8,7 @@ fn criterion_benchmark(c: &mut Criterion) { c.bench_function("decode_all_slice", |b| { b.iter(|| { - fr.decode_all(src, &mut target_...
4
10
10
75ed61d5c347b6dfa5717593cf80954e4ea59db7
Moritz Borcherding
2025-02-10T19:40:19
very simple heuristic deciding to keep the old huffman table
diff --git a/src/encoding/blocks/compressed.rs b/src/encoding/blocks/compressed.rs index 7307141..cb375b2 100644 --- a/src/encoding/blocks/compressed.rs +++ b/src/encoding/blocks/compressed.rs @@ -212,10 +212,18 @@ fn compress_literals( let reset_idx = writer.index(); let new_encoder_table = huff0_encoder::...
2
26
3
3d6139cfdfc1b9921a65c8adc86a2ccdebacea45
Moritz Borcherding
2025-02-09T17:58:07
plumbing to allow reusing the huffman table
diff --git a/src/encoding/blocks/compressed.rs b/src/encoding/blocks/compressed.rs index 28b750b..29462c2 100644 --- a/src/encoding/blocks/compressed.rs +++ b/src/encoding/blocks/compressed.rs @@ -1,15 +1,16 @@ use alloc::vec::Vec; use crate::{ + encoding::frame_compressor::CompressState, encoding::{bit_wri...
4
77
30
0668533e6819150cd0b750936b29b63cd8abbbe2
Moritz Borcherding
2025-01-24T14:37:45
consider more candidates for matches
diff --git a/src/encoding/match_generator.rs b/src/encoding/match_generator.rs index 0b184a1..d9f4d6c 100644 --- a/src/encoding/match_generator.rs +++ b/src/encoding/match_generator.rs @@ -234,6 +234,7 @@ impl MatchGenerator { let key = &data_slice[..MIN_MATCH_LEN]; // Look in each window en...
1
33
20
0461bc0df740700e7d386996b271860a45011984
Moritz Borcherding
2025-01-24T13:41:02
calculate and encode window size correctly
diff --git a/src/encoding/frame_header.rs b/src/encoding/frame_header.rs index 72ef406..ea32901 100644 --- a/src/encoding/frame_header.rs +++ b/src/encoding/frame_header.rs @@ -45,8 +45,11 @@ impl FrameHeader { // `Window_Descriptor // TODO: https://github.com/facebook/zstd/blob/dev/doc/zstd_compressi...
2
6
3
181ac6fa48103085cccb3bd1b64f1ac8938f037e
Moritz Borcherding
2024-12-28T19:21:23
expand test to also check filling in zeros
diff --git a/src/decoding/bit_reader_reverse.rs b/src/decoding/bit_reader_reverse.rs index b181589..b6a1de5 100644 --- a/src/decoding/bit_reader_reverse.rs +++ b/src/decoding/bit_reader_reverse.rs @@ -174,5 +174,11 @@ mod test { assert_eq!(br.get_bits(1), 0); assert_eq!(br.get_bits(4), 0b1010); ...
1
6
0
32849f43842d7f3e2d8212af26d95e6f261d44d9
Moritz Borcherding
2024-12-27T20:32:59
peek_bits_triple provides a small performance improvement
diff --git a/src/decoding/bit_reader_reverse.rs b/src/decoding/bit_reader_reverse.rs index fcc166f..b181589 100644 --- a/src/decoding/bit_reader_reverse.rs +++ b/src/decoding/bit_reader_reverse.rs @@ -100,6 +100,7 @@ impl<'s> BitReaderReversed<'s> { } /// Get the next `n` bits from the source without consum...
1
31
8
95e3b506383cd498eb358dea2e12d5fd7d1e35f0
Moritz Borcherding
2024-12-27T19:58:24
comments in the reverse bitreaders refill implementation
diff --git a/src/decoding/bit_reader_reverse.rs b/src/decoding/bit_reader_reverse.rs index f26edb1..fcc166f 100644 --- a/src/decoding/bit_reader_reverse.rs +++ b/src/decoding/bit_reader_reverse.rs @@ -47,11 +47,15 @@ impl<'s> BitReaderReversed<'s> { } if self.index >= bytes_consumed { + /...
1
6
0
42d1b3a401f5a14e627d0b1d809ef0776f1d9749
Jonathan Behrens
2024-12-27T17:55:38
Optimize and simplify `BitReaderReversed` (#81)
diff --git a/src/decoding/bit_reader_reverse.rs b/src/decoding/bit_reader_reverse.rs index 004dd09..f26edb1 100644 --- a/src/decoding/bit_reader_reverse.rs +++ b/src/decoding/bit_reader_reverse.rs @@ -1,223 +1,149 @@ -use crate::io::Read; use core::convert::TryInto; /// Zstandard encodes some types of data in a way...
1
93
167
1ed0ec8d2e65c9c605eccee330c69ff82b06e2bd
Moritz Borcherding
2024-12-23T15:40:36
cargo fmt
diff --git a/src/io_nostd.rs b/src/io_nostd.rs index 5eb1437..04191d9 100644 --- a/src/io_nostd.rs +++ b/src/io_nostd.rs @@ -128,7 +128,10 @@ pub trait Read { Ok(()) } - fn take(self, limit: u64) -> Take<Self> where Self: Sized { + fn take(self, limit: u64) -> Take<Self> + where + Self: ...
1
4
1
d7643f4689c611d6157ed71f4191f92ae022c977
Moritz Borcherding
2024-12-23T15:31:52
mention Read::take in the doc for the compressor and implement it for the nostd_io module
diff --git a/src/encoding/frame_compressor.rs b/src/encoding/frame_compressor.rs index 29cdfad..519bd52 100644 --- a/src/encoding/frame_compressor.rs +++ b/src/encoding/frame_compressor.rs @@ -76,6 +76,9 @@ impl<R: Read, W: Write, M: Matcher> FrameCompressor<R, W, M> { /// /// This will repeatedly call [Read:...
2
47
0
7be43815d17a8adefd503ae052bf5df21ca3fd34
Moritz Borcherding
2024-12-23T12:53:34
fix take_drain to do what it says on the tin
diff --git a/src/bin/zstd.rs b/src/bin/zstd.rs index 471389d..bdd80bd 100644 --- a/src/bin/zstd.rs +++ b/src/bin/zstd.rs @@ -159,8 +159,7 @@ fn main() { if flags.is_empty() { let mut encoder = FrameCompressor::new(CompressionLevel::Fastest); - let mut output = Vec::new(); - encoder.set_dra...
2
6
7
2cec9cf0c2780e22a88f110c1435814813fbc8f9
Moritz Borcherding
2024-12-21T19:59:07
better doc for FrameDecoder
diff --git a/src/decoding/frame_decoder.rs b/src/decoding/frame_decoder.rs index 1a0675b..6c230e6 100644 --- a/src/decoding/frame_decoder.rs +++ b/src/decoding/frame_decoder.rs @@ -14,7 +14,7 @@ use alloc::collections::BTreeMap; use alloc::vec::Vec; use core::convert::TryInto; -/// This implements a decoder for zst...
1
1
1
5c547f0f9db05d6fca8f13a131b941662b8425b8
Moritz Borcherding
2024-12-21T19:56:43
mention that the framedecoder allows reusing ressources
diff --git a/src/encoding/frame_compressor.rs b/src/encoding/frame_compressor.rs index d41facf..ac13559 100644 --- a/src/encoding/frame_compressor.rs +++ b/src/encoding/frame_compressor.rs @@ -1,4 +1,4 @@ -//! Utilities and interfaces for encoding an entire frame. +//! Utilities and interfaces for encoding an entire fr...
1
1
1
48f6f221db7d6f92f7db77b309d05b53eb37f078
Moritz Borcherding
2024-12-21T19:52:28
Make FrameCompressor doc nicer
diff --git a/src/encoding/frame_compressor.rs b/src/encoding/frame_compressor.rs index 4c91591..d41facf 100644 --- a/src/encoding/frame_compressor.rs +++ b/src/encoding/frame_compressor.rs @@ -72,51 +72,6 @@ impl<R: Read, W: Write, M: Matcher> FrameCompressor<R, W, M> { self.compressed_data.replace(compressed_...
1
51
45
8bb22b26833b14aba904ea6403560dfad8379243
Moritz Borcherding
2024-12-21T19:44:51
no std imports!
diff --git a/src/encoding/frame_compressor.rs b/src/encoding/frame_compressor.rs index 9e42ced..4c91591 100644 --- a/src/encoding/frame_compressor.rs +++ b/src/encoding/frame_compressor.rs @@ -104,7 +104,7 @@ impl<R: Read, W: Write, M: Matcher> FrameCompressor<R, W, M> { /// Before calling [FrameCompressor::comp...
1
2
2
c3022ede3c68b8e6bb4bd7fa5daa77eb5aa83815
Moritz Borcherding
2024-12-21T19:42:55
fix doc for compress_to_vec
diff --git a/src/encoding/mod.rs b/src/encoding/mod.rs index f512720..06f1ffd 100644 --- a/src/encoding/mod.rs +++ b/src/encoding/mod.rs @@ -27,7 +27,7 @@ pub fn compress<R: Read, W: Write>(source: R, target: W, level: CompressionLevel frame_enc.compress(); } -/// Convenience function to compress some source in...
1
1
1
f61fedcc2baa833d8eee7eb4c7b5f6aab1da2201
Moritz Borcherding
2024-12-21T19:41:48
update doc on FrameCompressor::compress
diff --git a/src/encoding/frame_compressor.rs b/src/encoding/frame_compressor.rs index db8bd9c..9e42ced 100644 --- a/src/encoding/frame_compressor.rs +++ b/src/encoding/frame_compressor.rs @@ -117,7 +117,10 @@ impl<R: Read, W: Write, M: Matcher> FrameCompressor<R, W, M> { compression_level } - /// Co...
1
4
1
45cbf306d0d5f93858955a6efc5e333cd93c074c
Moritz Borcherding
2024-12-21T19:33:51
allow creating a FrameCompressor without initially providing a source and drain
diff --git a/fuzz/fuzz_targets/encode.rs b/fuzz/fuzz_targets/encode.rs index 7048bef..8f28746 100644 --- a/fuzz/fuzz_targets/encode.rs +++ b/fuzz/fuzz_targets/encode.rs @@ -2,21 +2,17 @@ #[macro_use] extern crate libfuzzer_sys; extern crate ruzstd; -use ruzstd::encoding::{CompressionLevel, FrameCompressor}; +use ruz...
7
110
119
e084ff9d3fb558228ebcdce63a6b5d0109112695
Moritz Borcherding
2024-12-21T18:40:16
make the Matcher trait public and make the FrameEncoder generic over the used Matcher allowing users to provide their own implementation
diff --git a/src/encoding/blocks/compressed.rs b/src/encoding/blocks/compressed.rs index 58a13ba..28b750b 100644 --- a/src/encoding/blocks/compressed.rs +++ b/src/encoding/blocks/compressed.rs @@ -1,7 +1,7 @@ use alloc::vec::Vec; use crate::{ - encoding::{bit_writer::BitWriter, match_generator::Sequence, Matcher...
4
146
56
5f1710fadc0809166cba54825e3bb7147868c7d2
Moritz Borcherding
2024-12-16T19:11:53
comments and a few extra asserts on the bitwriter
diff --git a/src/encoding/bit_writer.rs b/src/encoding/bit_writer.rs index bbb4e92..fb80992 100644 --- a/src/encoding/bit_writer.rs +++ b/src/encoding/bit_writer.rs @@ -27,8 +27,6 @@ impl BitWriter<Vec<u8>> { } } -impl BitWriter<&mut Vec<u8>> {} - impl<V: AsMut<Vec<u8>>> BitWriter<V> { /// Initialize a ne...
1
30
4
a6faf93047e4f3d8633832b7547de6f574d246a2
Moritz Borcherding
2024-12-16T18:47:07
doc for matching and matcher trait
diff --git a/src/encoding/match_generator.rs b/src/encoding/match_generator.rs index 63e7262..10b758a 100644 --- a/src/encoding/match_generator.rs +++ b/src/encoding/match_generator.rs @@ -1,3 +1,10 @@ +//! Matching algorithm used find repeated parts in the original data +//! +//! The Zstd format relies on finden repea...
2
21
0
8b86e4bcc6f3169086fafa6cc6787bc9da24417d
Jake Goulding
2024-12-14T20:01:45
Upgrade to twox-hash 2.0 (#73)
diff --git a/Cargo.toml b/Cargo.toml index cb47f98..7f5305d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ keywords = ["zstd", "zstandard", "decompression"] categories = ["compression"] [dependencies] -twox-hash = { version = "1.6", default-features = false, optional = true } +twox-hash = { version = "2...
1
1
1
55062db6b66f1c1be1499fd60ad25e2acdd7ae10
Moritz Borcherding
2024-12-14T19:58:56
link to the rfc instead of a github page
diff --git a/src/lib.rs b/src/lib.rs index ff789b7..2a42513 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,4 @@ -//! A pure Rust implementation of the [Zstandard compression format](https://facebook.github.io/zstd/). +//! A pure Rust implementation of the [Zstandard compression format](https://www.rfc-editor.org/r...
1
1
1
c1a7a8eb84810f03e2f87da14b08b8da46af767b
Moritz Borcherding
2024-12-14T19:57:25
more doc improvements
diff --git a/src/decoding/errors.rs b/src/decoding/errors.rs index 41b42a0..7cb50ba 100644 --- a/src/decoding/errors.rs +++ b/src/decoding/errors.rs @@ -1,3 +1,5 @@ +//! Errors that might occur while decoding zstd formatted data + use crate::blocks::block::BlockType; use crate::blocks::literals_section::LiteralsSecti...
7
14
15
cb5d1280f0a2b6f61dffbe6b47fdaaf05dc5fe8a
Moritz Borcherding
2024-12-14T19:45:01
fix some references in the docs
diff --git a/src/decoding/frame_decoder.rs b/src/decoding/frame_decoder.rs index b32abf0..839da0b 100644 --- a/src/decoding/frame_decoder.rs +++ b/src/decoding/frame_decoder.rs @@ -1,6 +1,6 @@ //! Framedecoder is the man struct users interact with to decode zstd frames //! -//! Zstandard compressed data is made of on...
2
4
4
bec73b96fdde31813ebd9e67e8fa51537dd56b59
Moritz Borcherding
2024-12-14T16:09:02
no clippy I like RLE over Rle
diff --git a/src/blocks/block.rs b/src/blocks/block.rs index c8e63b7..1dbf4e8 100644 --- a/src/blocks/block.rs +++ b/src/blocks/block.rs @@ -6,6 +6,7 @@ pub enum BlockType { /// An uncompressed block. Raw, /// A single byte, repeated `Block_Size` times (Run Length Encoding). + #[allow(clippy::upper_ca...
3
3
0
6b1585fa3db165745f3421176260d183cad7bbcc
Moritz Borcherding
2024-12-14T16:03:48
cargo fmt
diff --git a/src/tests/mod.rs b/src/tests/mod.rs index 6b1299b..24695df 100644 --- a/src/tests/mod.rs +++ b/src/tests/mod.rs @@ -406,7 +406,8 @@ fn test_streaming_no_std() { let content = include_bytes!("../../decodecorpus_files/z000088.zst"); let mut content = content.as_slice(); - let mut stream = crat...
1
2
1
7f19f847b7fd53055398d17e8ff3c1f228051289
Moritz Borcherding
2024-12-14T16:01:31
fix imports in no_std tests
diff --git a/src/tests/mod.rs b/src/tests/mod.rs index b8ddf00..6b1299b 100644 --- a/src/tests/mod.rs +++ b/src/tests/mod.rs @@ -406,7 +406,7 @@ fn test_streaming_no_std() { let content = include_bytes!("../../decodecorpus_files/z000088.zst"); let mut content = content.as_slice(); - let mut stream = crat...
1
2
2
8a5430e9e90a067afe5157e793e51237bfcd3e61
Moritz Borcherding
2024-12-14T15:59:34
small wording correction
diff --git a/src/lib.rs b/src/lib.rs index c64e363..fa215de 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,4 @@ -//! A pure Rust implementation of the [Zstandard compression algorithm](https://facebook.github.io/zstd/). +//! A pure Rust implementation of the [Zstandard compression format](https://facebook.github.i...
1
1
1
0f6611bf95eb7dd1f331cc92ab50491b1d79f8e1
Moritz Borcherding
2024-12-14T15:58:45
fix unused functions warnings by either deleting or gating behind cfgs
diff --git a/src/decoding/bit_reader.rs b/src/decoding/bit_reader.rs index c30f168..2fba6db 100644 --- a/src/decoding/bit_reader.rs +++ b/src/decoding/bit_reader.rs @@ -120,9 +120,4 @@ impl<'s> BitReader<'s> { Ok(value) } - - pub fn reset(&mut self, new_source: &'s [u8]) { - self.idx = 0; - ...
9
11
37
e95ab2afd134fc8970c00f17b327f29fe5a249b1
Moritz Borcherding
2024-12-14T15:49:55
export functions for fuzzing behind a feature
diff --git a/src/fse/mod.rs b/src/fse/mod.rs index 7b43137..d443e28 100644 --- a/src/fse/mod.rs +++ b/src/fse/mod.rs @@ -77,6 +77,7 @@ fn roundtrip() { /// Encodes the data with a table built from that data /// Decodes the result again by first decoding the table and then the data /// Asserts that the decoded data e...
2
2
0
c5e57e01ae4a6adc9f723c592add167687437133
Moritz Borcherding
2024-12-14T15:46:12
export functions for fuzzing behind a feature
diff --git a/Cargo.toml b/Cargo.toml index 2e09003..cb47f98 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,6 +29,7 @@ zstd = "0.13.2" [features] default = ["hash", "std"] hash = ["dep:twox-hash"] +fuzz_exports = [] std = [] # Internal feature, only used when building as part of libstd, not part of the diff --gi...
3
11
0
1ce53b8878b9b29d1b05c9beaf0735ac3d6f2b28
Moritz Borcherding
2024-12-14T15:38:05
clarify doc on io module
diff --git a/src/io.rs b/src/io.rs index 7a90969..aab287b 100644 --- a/src/io.rs +++ b/src/io.rs @@ -1,3 +1,3 @@ -//! Re-exports of std values for when the std is available. +//! Re-exports of std values for when the std is available or local reimplementations if std is not available #[cfg(feature = "std")] pub use s...
1
1
1
d6783eb1d802e165071e558cd8907206ebaaad88
Moritz Borcherding
2024-12-14T15:33:32
hide all modules that aren't public API
diff --git a/src/lib.rs b/src/lib.rs index 0a93f2a..ad42683 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -23,7 +23,7 @@ extern crate std; extern crate alloc; #[cfg(feature = "std")] -pub const VERBOSE: bool = false; +pub(crate) const VERBOSE: bool = false; macro_rules! vprintln { ($($x:expr),*) => {
1
1
1
fcb0721a1c901018aae244e8f6046f0c33b06315
Moritz Borcherding
2024-12-14T15:33:02
hide all modules that aren't public API
diff --git a/Cargo.toml b/Cargo.toml index 57a7b99..2e09003 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,10 +35,6 @@ std = [] # stable interface of this crate. rustc-dep-of-std = ["dep:compiler_builtins", "dep:core", "dep:alloc"] -[[bench]] -name = "reversedbitreader_bench" -harness = false - [[bench]] name = ...
4
16
58
c5f17856c33077eabdb8594b5748949fe0f179ca
Moritz Borcherding
2024-12-14T14:03:27
since this is now both an encoder and decoder the modules need to be sorted out a bit
diff --git a/benches/decode_all.rs b/benches/decode_all.rs index 44455db..08be96f 100644 --- a/benches/decode_all.rs +++ b/benches/decode_all.rs @@ -1,5 +1,5 @@ use criterion::{criterion_group, criterion_main, Criterion}; -use ruzstd::FrameDecoder; +use ruzstd::decoding::frame_decoder::FrameDecoder; fn criterion_be...
28
124
99
4d4c2a1358e5f8a81a1c05c6e59d6d95d5874516
Sergey "Shnatsel" Davidoff
2024-11-28T20:51:40
Change fuzzing harness to be representative of real-world code. It can now find #75 (#77)
diff --git a/fuzz/fuzz_targets/decode.rs b/fuzz/fuzz_targets/decode.rs index ec1cc4a..4c88203 100644 --- a/fuzz/fuzz_targets/decode.rs +++ b/fuzz/fuzz_targets/decode.rs @@ -1,16 +1,11 @@ #![no_main] #[macro_use] extern crate libfuzzer_sys; extern crate ruzstd; -use ruzstd::frame_decoder; +use std::io::Read; fuzz_...
1
4
9
db68f68c1a83cdb33e12a66a23b5adec240db6bf
Paolo Barbolini
2024-11-28T09:59:41
Fix `RingBuffer::extend_from_within_unchecked` unsoundness (#76)
diff --git a/src/decoding/ringbuffer.rs b/src/decoding/ringbuffer.rs index e364d90..9af2a69 100644 --- a/src/decoding/ringbuffer.rs +++ b/src/decoding/ringbuffer.rs @@ -295,50 +295,170 @@ impl RingBuffer { /// 2. More then len reserved space so we do not write out-of-bounds #[warn(unsafe_op_in_unsafe_fn)] ...
1
151
31
453fd650fcb6093a6c7b47f857c5714899fff7de
Moritz Borcherding
2024-09-27T10:43:14
add benchmark for decode_all
diff --git a/Cargo.toml b/Cargo.toml index 1619430..49a4058 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,6 +38,10 @@ rustc-dep-of-std = ["dep:compiler_builtins", "dep:core", "dep:alloc"] name = "reversedbitreader_bench" harness = false +[[bench]] +name = "decode_all" +harness = false + [[bin]] name = "zstd" r...
3
22
1
b99a8b94686193d670dac4d6b9a06689ede662c0
Philip Craig
2024-09-18T11:01:43
Add `decode_all` and `decode_all_to_vec` (#70)
diff --git a/src/frame_decoder.rs b/src/frame_decoder.rs index e2566ef..6987bb1 100644 --- a/src/frame_decoder.rs +++ b/src/frame_decoder.rs @@ -102,6 +102,7 @@ pub enum FrameDecoderError { NotYetInitialized, FailedToInitialize(frame::FrameHeaderError), FailedToDrainDecodebuffer(Error), + FailedToSkip...
2
173
0
603ee2dfa5f0abe3a8bfc5fad6cb9782cdf37a68
Moritz Borcherding
2024-09-12T16:45:41
cargo fmt
diff --git a/src/decoding/bit_reader_reverse.rs b/src/decoding/bit_reader_reverse.rs index 55489cc..98546f4 100644 --- a/src/decoding/bit_reader_reverse.rs +++ b/src/decoding/bit_reader_reverse.rs @@ -54,7 +54,9 @@ impl<'s> BitReaderReversed<'s> { #[inline(always)] fn refill_fast(&mut self, byte_idx: usize, r...
1
3
1
6fb54c46aa1c5a0865185cd6ae39305ea9baf4d3
Moritz Borcherding
2024-09-12T16:43:17
try_into().unwrap() is faster than .read_exact() to get a [u8; 8] from a &[u8]
diff --git a/src/decoding/bit_reader_reverse.rs b/src/decoding/bit_reader_reverse.rs index 23bde05..55489cc 100644 --- a/src/decoding/bit_reader_reverse.rs +++ b/src/decoding/bit_reader_reverse.rs @@ -1,3 +1,5 @@ +use core::convert::TryInto; + pub use super::bit_reader::GetBitsError; use crate::io::Read; @@ -52,8 +...
1
3
2
bad8cfb311ad744b69ad506c2480e1349b4144ad
Moritz Borcherding
2024-09-06T15:40:34
make clippy happy again
diff --git a/src/blocks/literals_section.rs b/src/blocks/literals_section.rs index d7b908d..90e3c83 100644 --- a/src/blocks/literals_section.rs +++ b/src/blocks/literals_section.rs @@ -3,6 +3,7 @@ use super::super::decoding::bit_reader::{BitReader, GetBitsError}; /// A compressed block consists of two sections, a l...
6
10
5
3b777509b88f05b4dbfd09ffa0630b974ca9d516
Jubilee
2024-09-06T15:29:46
We are std. (#67) * Remove byteorder dependency * We are std.
diff --git a/Cargo.toml b/Cargo.toml index 1f2c5b7..989b770 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,9 +13,14 @@ keywords = ["zstd", "zstandard", "decompression"] categories = ["compression"] [dependencies] -byteorder = { version = "1.5", default-features = false } twox-hash = { version = "1.6", default-fea...
3
29
40
101df3eac0ba8684bcda98185582f8448f04d2ac
Moritz Borcherding
2024-05-30T20:59:23
bump version to 0.7.0
diff --git a/Cargo.toml b/Cargo.toml index b960058..bdd70fd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ruzstd" -version = "0.6.0" +version = "0.7.0" authors = ["Moritz Borcherding <moritz.borcherding@web.de>"] edition = "2018" license = "MIT"
1
1
1
c7ad34bc1c149dd34ebf0e65af7b2585b4bfcaf9
Moritz Borcherding
2024-05-30T20:58:31
fix doc on reverse bitreader
diff --git a/src/decoding/bit_reader_reverse.rs b/src/decoding/bit_reader_reverse.rs index 58c42ed..7ce56b1 100644 --- a/src/decoding/bit_reader_reverse.rs +++ b/src/decoding/bit_reader_reverse.rs @@ -108,8 +108,8 @@ impl<'s> BitReaderReversed<'s> { (self.idx - 1) / 8 } - /// Read `n` number of bits ...
1
3
2
53e7b1a6005a6871b773ee2a227e2a928bc90807
Moritz Borcherding
2024-05-29T16:32:53
fix doc comments for clippy
diff --git a/src/blocks/literals_section.rs b/src/blocks/literals_section.rs index 10501ec..d7b908d 100644 --- a/src/blocks/literals_section.rs +++ b/src/blocks/literals_section.rs @@ -6,16 +6,16 @@ use super::super::decoding::bit_reader::{BitReader, GetBitsError}; /// This is the first of those two sections. A litera...
1
5
5
16fee8cd454428d586879382a4fb145569b3b75c
Astrid Yu
2024-05-29T16:26:29
Implement accessors for inner reader on StreamDecoder (#62) * Implement accessors for inner reader on StreamDecoder
diff --git a/src/streaming_decoder.rs b/src/streaming_decoder.rs index b2cca27..fde7a9d 100644 --- a/src/streaming_decoder.rs +++ b/src/streaming_decoder.rs @@ -60,8 +60,39 @@ impl<READ: Read> StreamingDecoder<READ, FrameDecoder> { decoder.init(&mut source)?; Ok(StreamingDecoder { decoder, source }) ...
2
42
7
88f7a41677b325c3caa7b287c261a490a8e1038e
Moritz Borcherding
2024-04-18T21:03:05
use core instead of std
diff --git a/src/decoding/ringbuffer.rs b/src/decoding/ringbuffer.rs index fb7a3e5..8303edf 100644 --- a/src/decoding/ringbuffer.rs +++ b/src/decoding/ringbuffer.rs @@ -428,7 +428,7 @@ unsafe fn copy_bytes_overshooting( #[cfg(target_feature = "sse2")] type CopyType = u128; - const COPY_AT_ONCE_SIZE: usiz...
1
1
1
2ee37fdf5beabccdaa9fa1bdc3185d00c7ede9f4
Moritz Borcherding
2024-04-18T17:07:25
optimize the copying done in the ringbuffer
diff --git a/src/decoding/ringbuffer.rs b/src/decoding/ringbuffer.rs index 4f6e119..fb7a3e5 100644 --- a/src/decoding/ringbuffer.rs +++ b/src/decoding/ringbuffer.rs @@ -21,6 +21,7 @@ pub struct RingBuffer { // SAFETY: RingBuffer does not hold any thread specific values -> it can be sent to another thread -> RingBuff...
1
88
19
729e5df75a99a17dee99d37d31822eab2c5facbf
Sorseg
2024-04-01T13:19:31
Add documentation on how to handle SkipFrames
diff --git a/src/streaming_decoder.rs b/src/streaming_decoder.rs index 52aa10c..3021e3f 100644 --- a/src/streaming_decoder.rs +++ b/src/streaming_decoder.rs @@ -8,6 +8,14 @@ use crate::io::{Error, ErrorKind, Read}; /// /// The lower level FrameDecoder by comparison allows for finer grained control but need sto have i...
1
8
0
71797f4320a5048bccdd23ecad730873859f6e2a
Sorseg
2024-04-01T13:19:31
Add names to error fields
diff --git a/src/bin/zstd.rs b/src/bin/zstd.rs index 1006179..af5760f 100644 --- a/src/bin/zstd.rs +++ b/src/bin/zstd.rs @@ -62,10 +62,10 @@ fn main() { while tracker.file_pos < tracker.file_size { match frame_dec.reset(&mut f) { - Err(FrameDecoderError::ReadFrameHeaderError(ReadF...
3
20
12
28a309ac8cb74f62b8e0129e2dffc485d4c7da34
Moritz Borcherding
2024-04-01T10:46:52
refactoring DecodeBuffer::repeat with a #[cold] annotation improves performance by a few percent
diff --git a/src/decoding/decodebuffer.rs b/src/decoding/decodebuffer.rs index 4e7663c..40c82a4 100644 --- a/src/decoding/decodebuffer.rs +++ b/src/decoding/decodebuffer.rs @@ -79,36 +79,7 @@ impl Decodebuffer { pub fn repeat(&mut self, offset: usize, match_length: usize) -> Result<(), DecodebufferError> { ...
1
70
58
4bf205a448e70fad46651d086f766ffc9e44126c
Moritz Borcherding
2024-03-25T17:34:47
fix skippable frame support in the provided binary, did not account for the 8 bytes of header while tracking progress
diff --git a/src/bin/zstd.rs b/src/bin/zstd.rs index d8db978..1006179 100644 --- a/src/bin/zstd.rs +++ b/src/bin/zstd.rs @@ -67,6 +67,7 @@ fn main() { skip_size, ))) => { eprintln!("Found a skippable frame with magic number: {magic_num} and size: {skip_size}");...
1
1
0
e0d32e83b4170d9cd3d5b9a35f2f655ed0cec75a
Moritz Borcherding
2024-02-18T16:24:04
bump version to 0.5.1 and update criterion dependency
diff --git a/Cargo.toml b/Cargo.toml index f852b7e..35c26a7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ruzstd" -version = "0.5.0" +version = "0.5.1" authors = ["Moritz Borcherding <moritz.borcherding@web.de>"] edition = "2018" license = "MIT" @@ -18,7 +18,7 @@ twox-hash = { version ...
1
2
2
a16e38be5c94279a9ab8890f4eb8578acacad006
Moritz Borcherding
2024-02-18T10:48:38
make RingBuffer Send + Sync so that the FrameDecoder is Send + Sync
diff --git a/src/decoding/ringbuffer.rs b/src/decoding/ringbuffer.rs index 041fec5..4f6e119 100644 --- a/src/decoding/ringbuffer.rs +++ b/src/decoding/ringbuffer.rs @@ -19,6 +19,11 @@ pub struct RingBuffer { tail: usize, } +// SAFETY: RingBuffer does not hold any thread specific values -> it can be sent to anot...
2
17
0
6ab76d53c70dc6b70b648e8fe57f88aa48019368
Alphyr
2024-01-20T22:05:00
Add crate category and keywords
diff --git a/Cargo.toml b/Cargo.toml index 77beeba..f852b7e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,6 +9,8 @@ repository = "https://github.com/KillingSpark/zstd-rs" description = "A decoder for the zstd compression format" exclude = ["decodecorpus_files/*", "dict_tests/*", "fuzz_decodecorpus/*"] readme = "Rea...
1
2
0
e5100ce8b75fcd79283b6f9decda83177de7f12b
Moritz Borcherding
2023-10-29T10:32:44
revert from Default::default to XxHash64::with_seed to make sure this stays spec compliant
diff --git a/src/decoding/decodebuffer.rs b/src/decoding/decodebuffer.rs index 8a620fa..4e7663c 100644 --- a/src/decoding/decodebuffer.rs +++ b/src/decoding/decodebuffer.rs @@ -48,7 +48,7 @@ impl Decodebuffer { window_size, total_output_counter: 0, #[cfg(feature = "hash")] - ...
1
2
2
08b3a906f41f76b08e02a2455f81d6d018147b75
Tamir Duberstein
2023-10-27T14:36:04
Make twox-hash an optional dependency Add a new feature "hash" which pulls in twox-hash and hashes during decoding. Add "hash" to default features. Fixes #52.
diff --git a/Cargo.toml b/Cargo.toml index fbb4867..77beeba 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,15 +12,16 @@ readme = "Readme.md" [dependencies] byteorder = { version = "1.5", default-features = false } -twox-hash = { version = "1.6", default-features = false } +twox-hash = { version = "1.6", default-fe...
7
43
11
9e9d204c63e351af81b211cdb0f1a90ffabb4586
Moritz Borcherding
2023-10-23T19:26:54
make clippy happy
diff --git a/src/fse/fse_decoder.rs b/src/fse/fse_decoder.rs index 3db1b5f..969768f 100644 --- a/src/fse/fse_decoder.rs +++ b/src/fse/fse_decoder.rs @@ -72,7 +72,7 @@ fn highest_bit_set(x: u32) -> u32 { impl<'t> FSEDecoder<'t> { pub fn new(table: &'t FSETable) -> FSEDecoder<'_> { FSEDecoder { - ...
1
1
1
f4a6fc0cc1380308674c06441e2c55f8a65b21b5
Moritz Borcherding
2023-10-23T19:22:10
bump the version, this is an incompatible change
diff --git a/Cargo.toml b/Cargo.toml index 6dbf743..fbb4867 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ruzstd" -version = "0.4.0" +version = "0.5.0" authors = ["Moritz Borcherding <moritz.borcherding@web.de>"] edition = "2018" license = "MIT"
1
1
1
64d65b5c4f2bcad71cc41076d61b85629e36a041
Moritz Borcherding
2023-10-14T15:58:45
fix test compile...
diff --git a/src/tests/mod.rs b/src/tests/mod.rs index 5e13135..32f55a4 100644 --- a/src/tests/mod.rs +++ b/src/tests/mod.rs @@ -16,7 +16,7 @@ impl crate::io_nostd::Read for std::fs::File { } else { crate::io_nostd::Error::new( crate::io_nostd::ErrorKind::Other, - ...
1
1
1
07bbda98c863f4347280abf21c8395bcf49872fc
Moritz Borcherding
2023-10-14T15:51:08
remove the error_in_core feature and switch the io_nostd to use the Display trait
diff --git a/Cargo.toml b/Cargo.toml index 733d0df..6dbf743 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ rand = {version = "0.8.5", features = ["small_rng"]} [features] default = ["std"] -std = [] +std = ["derive_more/error"] [[bench]] name = "reversedbitreader_bench" diff --git a/src/blocks/liter...
18
83
48
92a3f2e6b2cc625710ba93efb137e6d164c3e457
Tamir Duberstein
2023-10-13T16:45:53
Avoid unnecessary cast warning: casting to the same type is unnecessary (`u64` -> `u64`) --> benches/reversedbitreader_bench.rs:8:16 | 8 | sum += br.get_bits(*x).unwrap() as u64; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `br.get_bits(*x).unwrap()` | = help: for further information vi...
diff --git a/benches/reversedbitreader_bench.rs b/benches/reversedbitreader_bench.rs index b6ff788..7b8d1a4 100644 --- a/benches/reversedbitreader_bench.rs +++ b/benches/reversedbitreader_bench.rs @@ -5,7 +5,7 @@ use ruzstd::decoding::bit_reader_reverse::BitReaderReversed; fn do_all_accesses(br: &mut BitReaderReversed...
1
1
1
f588d5c3629ef07032ce2f66db225ffb58d36609
Tamir Duberstein
2023-10-13T16:44:42
Avoid slow zero-filling initialization warning: slow zero-filling initialization --> src/tests/mod.rs:355:5 | 354 | let mut result = Vec::new(); | ---------- help: consider replacing this with: `vec![0; original.len()]` 355 | result.resize(original.len(), 0); | ^^^^^^^^^...
diff --git a/src/tests/mod.rs b/src/tests/mod.rs index 0f25073..560837a 100644 --- a/src/tests/mod.rs +++ b/src/tests/mod.rs @@ -351,8 +351,7 @@ fn test_streaming_no_std() { let mut stream = crate::streaming_decoder::StreamingDecoder::new(&mut content).unwrap(); let original = include_bytes!("../../decodeco...
1
2
4
e79f09876f5612373dbad1ef819bbb8fe3ca061d
Tamir Duberstein
2023-10-13T16:27:59
Avoid single-match expression warning: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> src/tests/fuzz_regressions.rs:20:9 | 20 | / match frame_dec.reset(&mut f) { 21 | | Ok(_) => { 22 | | let _ = frame_dec.decode_blocks(&mut ...
diff --git a/src/tests/fuzz_regressions.rs b/src/tests/fuzz_regressions.rs index bc675ca..e068bd9 100644 --- a/src/tests/fuzz_regressions.rs +++ b/src/tests/fuzz_regressions.rs @@ -17,12 +17,10 @@ fn test_all_artifacts() { } let mut f = File::open(file_name.clone()).unwrap(); - match frame_de...
1
5
7
c75cc2fbb9aa803676e56a8b24f2c6ac08c00ce4
Tamir Duberstein
2023-10-13T16:25:11
Remove useless assertion warning: returned pointer of `as_ptr` call is never null, so checking it for null will always return false --> src/decoding/ringbuffer.rs:271:24 | 271 | debug_assert!(!self.buf.as_ptr().is_null()); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[war...
diff --git a/src/decoding/ringbuffer.rs b/src/decoding/ringbuffer.rs index a9da2ed..041fec5 100644 --- a/src/decoding/ringbuffer.rs +++ b/src/decoding/ringbuffer.rs @@ -268,8 +268,6 @@ impl RingBuffer { /// 2. More then len reserved space so we do not write out-of-bounds #[warn(unsafe_op_in_unsafe_fn)] p...
1
0
2
e32b3f7e963196db12d3b53f83cf5503e61513cf
Moritz Borcherding
2023-10-13T16:22:40
make clippy happy
diff --git a/src/decoding/ringbuffer.rs b/src/decoding/ringbuffer.rs index a9da2ed..041fec5 100644 --- a/src/decoding/ringbuffer.rs +++ b/src/decoding/ringbuffer.rs @@ -268,8 +268,6 @@ impl RingBuffer { /// 2. More then len reserved space so we do not write out-of-bounds #[warn(unsafe_op_in_unsafe_fn)] p...
1
0
2
8b3057b41db96266d3f22a63efdfd3175f634f12
Moritz Borcherding
2023-10-13T16:18:41
cargo fmt
diff --git a/src/blocks/literals_section.rs b/src/blocks/literals_section.rs index d8e9d71..0289c0c 100644 --- a/src/blocks/literals_section.rs +++ b/src/blocks/literals_section.rs @@ -22,7 +22,9 @@ pub enum LiteralsSectionParseError { #[display(fmt = "{_0:?}")] #[from] GetBitsError(GetBitsError), - #...
5
16
8
f69c6c994acda7daa7a2b753992af31f4078d8fa
Moritz Borcherding
2023-10-13T16:15:31
move from thiserror to derive_more to get the same derived formatting for the error enums, dropping the error trait that was messing with the no_std builds
diff --git a/Cargo.toml b/Cargo.toml index c90b8e0..733d0df 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,9 +11,9 @@ exclude = ["decodecorpus_files/*", "dict_tests/*", "fuzz_decodecorpus/*"] readme = "Readme.md" [dependencies] -byteorder = { version = "1.4", default-features = false } +byteorder = { version = "1....
14
239
175
6242d1566adcd68f95a62a211ce518cb884ba1c7
Moritz Borcherding
2023-08-27T08:19:45
make benchmark deterministic
diff --git a/Cargo.toml b/Cargo.toml index e18cd80..c90b8e0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ thiserror = { package = "thiserror-core", version = "1.0.38", default-features = [dev-dependencies] criterion = "0.3" -rand = "0.8.5" +rand = {version = "0.8.5", features = ["small_rng"]} [featu...
2
10
8
c801a4b93c1e612d6ada20085dd37a9b34d8cab7
Moritz Borcherding
2023-08-26T10:51:31
demote &mut to & where unnecessary
diff --git a/src/decoding/sequence_section_decoder.rs b/src/decoding/sequence_section_decoder.rs index 6c366fb..27ad4b2 100644 --- a/src/decoding/sequence_section_decoder.rs +++ b/src/decoding/sequence_section_decoder.rs @@ -73,7 +73,7 @@ pub fn decode_sequences( fn decode_sequences_with_rle( section: &SequencesH...
1
2
2
34ff9671f1a759f157d2150da4720e31a5792486
Moritz Borcherding
2023-08-26T10:46:58
improve analysis of safety requirements on callsites of unsafe functions
diff --git a/src/decoding/decodebuffer.rs b/src/decoding/decodebuffer.rs index 33cc58c..15f43e2 100644 --- a/src/decoding/decodebuffer.rs +++ b/src/decoding/decodebuffer.rs @@ -120,8 +120,18 @@ impl Decodebuffer { while copied_counter_left > 0 { let chunksize = usize::min(offset, c...
2
28
6
70c402753ad65692826f1e0337ac52dc41587e7a
Manish Goregaokar
2023-08-21T21:47:29
safety comments in ringbuffer
diff --git a/src/decoding/ringbuffer.rs b/src/decoding/ringbuffer.rs index fc9a2e3..1e82398 100644 --- a/src/decoding/ringbuffer.rs +++ b/src/decoding/ringbuffer.rs @@ -2,6 +2,17 @@ use alloc::alloc::{alloc, dealloc}; use core::{alloc::Layout, ptr::NonNull, slice}; pub struct RingBuffer { + // Safety invariants:...
1
37
0
402ea763d7e2282e42aedabbc6bed52c9ee09a4c
Moritz Borcherding
2023-07-07T06:16:09
make clippy happy
diff --git a/src/blocks/literals_section.rs b/src/blocks/literals_section.rs index 159e3b3..8f2aa51 100644 --- a/src/blocks/literals_section.rs +++ b/src/blocks/literals_section.rs @@ -150,7 +150,7 @@ impl LiteralsSection { 0 => { self.num_streams = Some(1); ...
1
1
1
548d2c265538868a5fd550e85d4eb2d502a6f801
Moritz Borcherding
2023-05-18T19:50:11
remove unnecessary mut
diff --git a/src/frame_decoder.rs b/src/frame_decoder.rs index 18af6b3..b871fe4 100644 --- a/src/frame_decoder.rs +++ b/src/frame_decoder.rs @@ -442,7 +442,7 @@ impl FrameDecoder { //pseudo block to scope "state" so we can borrow self again after the block { - let mut state = ...
1
1
1
aa09639562f5073fcdfa6b8bd37b6c32d5e64b41
Moritz Borcherding
2023-05-18T17:38:23
bump version to 0.4.0
diff --git a/Cargo.toml b/Cargo.toml index da76a80..e18cd80 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ruzstd" -version = "0.3.1" +version = "0.4.0" authors = ["Moritz Borcherding <moritz.borcherding@web.de>"] edition = "2018" license = "MIT"
1
1
1
fa7bd9c7b34343679399d88e6234da495fd997ad
Moritz Borcherding
2023-03-31T19:06:36
allow streaming decoder to also be used with a &mut FrameDecoder for easier reusing of the decoder
diff --git a/src/streaming_decoder.rs b/src/streaming_decoder.rs index d033fbc..f345a89 100644 --- a/src/streaming_decoder.rs +++ b/src/streaming_decoder.rs @@ -1,3 +1,5 @@ +use core::borrow::BorrowMut; + use crate::frame_decoder::{BlockDecodingStrategy, FrameDecoder, FrameDecoderError}; use crate::io::{Error, ErrorK...
1
22
15
3b6403b8e73abbe54c6fb317a1f92a90281cb002
Moritz Borcherding
2023-03-31T18:56:50
reenable forcing a different dict
diff --git a/src/frame_decoder.rs b/src/frame_decoder.rs index 7aeeb4b..18af6b3 100644 --- a/src/frame_decoder.rs +++ b/src/frame_decoder.rs @@ -209,6 +209,22 @@ impl FrameDecoder { Ok(()) } + pub fn force_dict(&mut self, dict_id: u32) -> Result<(), FrameDecoderError> { + use FrameDecoderError...
1
16
0
343d69b3396f6e7d59e042430ac860e56369991c
Moritz Borcherding
2023-03-31T18:36:02
no need to check that the dict still matches at the start of each decode call
diff --git a/src/frame_decoder.rs b/src/frame_decoder.rs index e526171..7aeeb4b 100644 --- a/src/frame_decoder.rs +++ b/src/frame_decoder.rs @@ -105,8 +105,8 @@ pub enum FrameDecoderError { FailedToDrainDecodebuffer(#[source] Error), #[error("Target must have at least as many bytes as the contentsize of the f...
1
18
33
d73f5e689a4ee2f001cd3a4b54b96d65a3c79e20
Moritz Borcherding
2023-03-30T17:25:25
cargo fmt
diff --git a/src/decoding/scratch.rs b/src/decoding/scratch.rs index fd52305..35d5c61 100644 --- a/src/decoding/scratch.rs +++ b/src/decoding/scratch.rs @@ -62,7 +62,9 @@ impl DecoderScratch { self.huf.table.reinit_from(&dict.huf.table); self.offset_hist = dict.offset_hist; self.buffer.dict_c...
1
3
1
f3f09c76f05c1e61a7cfe0f3f7607703d693c6d0
Moritz Borcherding
2023-03-30T17:25:03
improve initing the decoder from a dict
diff --git a/src/decoding/scratch.rs b/src/decoding/scratch.rs index bd6e5f9..fd52305 100644 --- a/src/decoding/scratch.rs +++ b/src/decoding/scratch.rs @@ -57,11 +57,12 @@ impl DecoderScratch { self.huf.table.reset(); } - pub fn use_dict(&mut self, dict: &Dictionary) { + pub fn init_from_dict(&mu...
2
5
4