diff
Sequence Comparison and Diff
Functions
| Function | Description |
|---|---|
_diff_byte_at | Internal byte reader. |
diff_lcs_len | Compute Longest Common Subsequence length. Uses O(n*m) DP. Max input ~200 cha… |
diff_ratio | Compute similarity ratio * 10000. ratio = 2 * lcs_len / (alen + blen) * 10000 |
diff_lines | Simple line-by-line diff output. Lines prefixed with +/- / (space). Compares … |
Details
_diff_byte_at
fn _diff_byte_at(buf: &i8, idx: i64) -> i64Internal byte reader.
diff_lcs_len
fn diff_lcs_len(a: &i8, alen: i64, b: &i8, blen: i64) -> i64Compute Longest Common Subsequence length. Uses O(n*m) DP. Max input ~200 chars (limited by alloc_pages).
diff_ratio
fn diff_ratio(a: &i8, alen: i64, b: &i8, blen: i64) -> i64Compute similarity ratio * 10000. ratio = 2 * lcs_len / (alen + blen) * 10000
diff_lines
fn diff_lines(a: &i8, alen: i64, b: &i8, blen: i64, out: &i8, max: i64) -> i64Simple line-by-line diff output. Lines prefixed with +/- / (space). Compares byte-by-byte (not line-aware for simplicity). Returns length written to out.