Replace runs of base32 characters (Atomic state identities) with a placeholder so cross-repository comparisons compare shapes, not per-repository change hashes.
(text: &str)
| 104 | /// placeholder so cross-repository comparisons compare shapes, not |
| 105 | /// per-repository change hashes. |
| 106 | fn normalize_base32(text: &str) -> String { |
| 107 | let mut normalized = String::with_capacity(text.len()); |
| 108 | let mut run = String::new(); |
| 109 | for character in text.chars() { |
| 110 | // Standard base32 (RFC 4648): uppercase letters plus digits 2-7. |
| 111 | let matches = character.is_ascii_uppercase() || ('2'..='7').contains(&character); |
| 112 | if matches { |
| 113 | run.push(character); |
| 114 | } else { |
| 115 | if run.len() >= 32 { |
| 116 | normalized.push_str("<state>"); |
| 117 | } else { |
| 118 | normalized.push_str(&run); |
| 119 | } |
| 120 | run.clear(); |
| 121 | normalized.push(character); |
| 122 | } |
| 123 | } |
| 124 | if run.len() >= 32 { |
| 125 | normalized.push_str("<state>"); |
| 126 | } else { |
| 127 | normalized.push_str(&run); |
| 128 | } |
| 129 | normalized |
| 130 | } |
| 131 | |
| 132 | fn git_ok(root: &Path, args: &[&str]) -> String { |
| 133 | let output = git(root, args); |
no test coverage detected