pub fn encode(
tag: usize,
base_data: &[u8],
new_data: &[u8],
enable_zstd: bool,
) -> Vec<u8> ⓘExpand description
Encodes the difference between base data and new data as a compact delta.
Automatically selects the best compression algorithm based on change analysis. Returns a delta that can be applied to the base data to reconstruct the new data.
§Arguments
tag- User-defined metadata value (can be used as history reference, version tag, etc.)base_data- The base data to compare againstnew_data- The new data to encodeenable_zstd- Whether to enable zstd compression for GDelta