summaryrefslogtreecommitdiff
path: root/vendor/miniz_oxide/src/shared.rs
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2024-01-08 00:21:28 +0300
committerValentin Popov <valentin@popov.link>2024-01-08 00:21:28 +0300
commit1b6a04ca5504955c571d1c97504fb45ea0befee4 (patch)
tree7579f518b23313e8a9748a88ab6173d5e030b227 /vendor/miniz_oxide/src/shared.rs
parent5ecd8cf2cba827454317368b68571df0d13d7842 (diff)
downloadfparkan-1b6a04ca5504955c571d1c97504fb45ea0befee4.tar.xz
fparkan-1b6a04ca5504955c571d1c97504fb45ea0befee4.zip
Initial vendor packages
Signed-off-by: Valentin Popov <valentin@popov.link>
Diffstat (limited to 'vendor/miniz_oxide/src/shared.rs')
-rw-r--r--vendor/miniz_oxide/src/shared.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/vendor/miniz_oxide/src/shared.rs b/vendor/miniz_oxide/src/shared.rs
new file mode 100644
index 0000000..8b81fb1
--- /dev/null
+++ b/vendor/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()
+}