Showing the changes to git-features/src (1 of 4 files). Show all
Unified · Split
| @@ -55,6 +55,7 @@ pub use _impl::Sha1; · 54 unmodified lines | |||
| 55 | /// When calling this function for the first time, `previous_value` should be `0`. Otherwise it | 55 | /// When calling this function for the first time, `previous_value` should be `0`. Otherwise it |
| 56 | /// should be the previous return value of this function to provide a hash of multiple sequential | 56 | /// should be the previous return value of this function to provide a hash of multiple sequential |
| 57 | /// chunks of `bytes`. | 57 | /// chunks of `bytes`. |
| 58 | #[cfg(feature = "crc32")] | ||
| 58 | pub fn crc32_update(previous_value: u32, bytes: &[u8]) -> u32 { | 59 | pub fn crc32_update(previous_value: u32, bytes: &[u8]) -> u32 { |
| 59 | crc::crc32::update(previous_value, &crc::crc32::IEEE_TABLE, bytes) | 60 | crc::crc32::update(previous_value, &crc::crc32::IEEE_TABLE, bytes) |
| 60 | } | 61 | } |
| @@ -62,6 +63,7 @@ pub fn crc32_update(previous_value: u32, bytes: &[u8]) -> u32 { · 1 unmodified line | |||
| 62 | /// Compute a CRC32 value of the given input `bytes`. | 63 | /// Compute a CRC32 value of the given input `bytes`. |
| 63 | /// | 64 | /// |
| 64 | /// In case multiple chunkes of `bytes` are present, one should use [`crc32_update()`] instead. | 65 | /// In case multiple chunkes of `bytes` are present, one should use [`crc32_update()`] instead. |
| 66 | #[cfg(feature = "crc32")] | ||
| 65 | pub use crc::crc32::checksum_ieee as crc32; | 67 | pub use crc::crc32::checksum_ieee as crc32; |
| 66 | 68 | ||
| 67 | /// Compute the hash of `kind` for the bytes in the file at `path`, hashing only the first `num_bytes_from_start` | 69 | /// Compute the hash of `kind` for the bytes in the file at `path`, hashing only the first `num_bytes_from_start` |