From ad0f8fef9c532720fb9603a0341ff7d176af2fc4 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Sun, 28 Jun 2020 18:34:08 +0200 Subject: [PATCH] Switch from adler32 to adler crate (#83) --- miniz_oxide/Cargo.toml | 4 ++-- miniz_oxide/src/shared.rs | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/miniz_oxide/Cargo.toml b/miniz_oxide/Cargo.toml index 70733f72..25bc5afc 100644 --- a/miniz_oxide/Cargo.toml +++ b/miniz_oxide/Cargo.toml @@ -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. @@ -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'] diff --git a/miniz_oxide/src/shared.rs b/miniz_oxide/src/shared.rs index 9628ea38..dcdec958 100644 --- a/miniz_oxide/src/shared.rs +++ b/miniz_oxide/src/shared.rs @@ -1,4 +1,4 @@ -use adler32::RollingAdler32; +use adler::Adler32; #[doc(hidden)] pub const MZ_ADLER32_INIT: u32 = 1; @@ -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() }