apply_patch

Function apply_patch 

Source
pub fn apply_patch(patch: &PatchFile, base_data: &[u8]) -> Result<Vec<u8>>
Expand description

Apply a patch file to base data

§Arguments

  • patch - The parsed patch file containing header and patch data
  • base_data - The original file data to patch

§Returns

The patched file data

§Errors

Returns error if:

  • Base file MD5 doesn’t match expected hash
  • Patch application fails
  • Patched result MD5 doesn’t match expected hash
  • Unsupported patch type (BSD0 not yet implemented)