Skip to content

Commit

Permalink
Switch from adler32 to adler crate (#83)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonas-schievink committed Jun 28, 2020
1 parent 7f5aedd commit ad0f8fe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions miniz_oxide/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ exclude = ["benches/*", "tests/*"]
name = "miniz_oxide"

[dependencies]
adler32 = { version = "1.1.0", default-features = false }
adler = { version = "0.2.1", default-features = false }

# Internal feature, only used when building as part of libstd, not part of the
# stable interface of this crate.
Expand All @@ -28,4 +28,4 @@ compiler_builtins = { version = '0.1.2', optional = true }
[features]
# Internal feature, only used when building as part of libstd, not part of the
# stable interface of this crate.
rustc-dep-of-std = ['core', 'alloc', 'compiler_builtins', 'adler32/rustc-dep-of-std']
rustc-dep-of-std = ['core', 'alloc', 'compiler_builtins', 'adler/rustc-dep-of-std']
8 changes: 4 additions & 4 deletions miniz_oxide/src/shared.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use adler32::RollingAdler32;
use adler::Adler32;

#[doc(hidden)]
pub const MZ_ADLER32_INIT: u32 = 1;
Expand All @@ -12,7 +12,7 @@ pub const HUFFMAN_LENGTH_ORDER: [u8; 19] = [

#[doc(hidden)]
pub fn update_adler32(adler: u32, data: &[u8]) -> u32 {
let mut hash = RollingAdler32::from_value(adler);
hash.update_buffer(data);
hash.hash()
let mut hash = Adler32::from_checksum(adler);
hash.write_slice(data);
hash.checksum()
}

0 comments on commit ad0f8fe

Please sign in to comment.