summaryrefslogtreecommitdiffstats
path: root/third_party/rust/miniz_oxide/src/shared.rs
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/rust/miniz_oxide/src/shared.rs')
-rw-r--r--third_party/rust/miniz_oxide/src/shared.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/third_party/rust/miniz_oxide/src/shared.rs b/third_party/rust/miniz_oxide/src/shared.rs
new file mode 100644
index 0000000000..8b81fb112b
--- /dev/null
+++ b/third_party/rust/miniz_oxide/src/shared.rs
@@ -0,0 +1,25 @@
+#[doc(hidden)]
+pub const MZ_ADLER32_INIT: u32 = 1;
+
+#[doc(hidden)]
+pub const MZ_DEFAULT_WINDOW_BITS: i32 = 15;
+
+pub const HUFFMAN_LENGTH_ORDER: [u8; 19] = [
+ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15,
+];
+
+#[doc(hidden)]
+#[cfg(not(feature = "simd"))]
+pub fn update_adler32(adler: u32, data: &[u8]) -> u32 {
+ let mut hash = adler::Adler32::from_checksum(adler);
+ hash.write_slice(data);
+ hash.checksum()
+}
+
+#[doc(hidden)]
+#[cfg(feature = "simd")]
+pub fn update_adler32(adler: u32, data: &[u8]) -> u32 {
+ let mut hash = simd_adler32::Adler32::from_checksum(adler);
+ hash.write(data);
+ hash.finish()
+}