Skip to content

Commit

Permalink
feat!: reducing the max chunk size from 1MB to 500kB
Browse files Browse the repository at this point in the history
  • Loading branch information
bochaco authored and joshuef committed Feb 22, 2023
1 parent 7f2b706 commit 7577322
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 92 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ jobs:
- name: rust-tarpaulin code coverage check
uses: actions-rs/tarpaulin@v0.1
with:
args: "-v --release --out Lcov"
args: "-v --release"
version: "0.15.0"
out-type: Lcov
timeout: 2000
- name: Push code coverage results to coveralls.io
uses: coverallsapp/github-action@master
Expand Down
2 changes: 1 addition & 1 deletion examples/basic_encryptor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ impl DiskBasedStorage {

fn get(&self, name: XorName) -> Result<Bytes, Error> {
let path = self.calculate_path(name);
let mut file = File::open(&path)?;
let mut file = File::open(path)?;
let mut data = Vec::new();
let _ = file.read_to_end(&mut data);
Ok(Bytes::from(data))
Expand Down
4 changes: 2 additions & 2 deletions src/data_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ impl Debug for ChunkInfo {
formatter,
"ChunkInfo {{ index: {}, dst_hash: {}, src_hash: {}, src_size: {} }}",
self.index,
debug_bytes(&self.dst_hash),
debug_bytes(&self.src_hash),
debug_bytes(self.dst_hash),
debug_bytes(self.src_hash),
self.src_size
)
}
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ pub use xor_name;

/// The minimum size (before compression) of data to be self-encrypted, defined as 3kB.
pub const MIN_ENCRYPTABLE_BYTES: usize = 3 * MIN_CHUNK_SIZE;
/// The maximum size (before compression) of an individual chunk of the file, defined as 1MB.
pub const MAX_CHUNK_SIZE: usize = 1024 * 1024;
/// The maximum size (before compression) of an individual chunk of the file, defined as 500kB.
pub const MAX_CHUNK_SIZE: usize = 500 * 1024;
/// The minimum size (before compression) of an individual chunk of the file, defined as 1kB.
pub const MIN_CHUNK_SIZE: usize = 1024;
/// Controls the compression-speed vs compression-density tradeoffs. The higher the quality, the
Expand Down

0 comments on commit 7577322

Please sign in to comment.