diff --git a/block/src/vhdx/vhdx_header.rs b/block/src/vhdx/vhdx_header.rs index efbab3390..edb1c652a 100644 --- a/block/src/vhdx/vhdx_header.rs +++ b/block/src/vhdx/vhdx_header.rs @@ -192,9 +192,7 @@ impl Header { }; new_header.get_header_as_buffer(&mut buffer); - let mut crc = crc_any::CRC::crc32c(); - crc.digest(&buffer); - new_header.checksum = crc.get_crc() as u32; + new_header.checksum = calculate_checksum(&mut buffer, size_of::()); new_header.get_header_as_buffer(&mut buffer); f.seek(SeekFrom::Start(start))