Lowercase-hex decode (test helper; the hex crate is not a dependency).
(hex: &str)
| 170 | |
| 171 | /// Lowercase-hex decode (test helper; the hex crate is not a dependency). |
| 172 | fn decode_hex(hex: &str) -> Vec<u8> { |
| 173 | (0..hex.len()) |
| 174 | .step_by(2) |
| 175 | .map(|index| u8::from_str_radix(&hex[index..index + 2], 16).unwrap()) |
| 176 | .collect() |
| 177 | } |
| 178 | |
| 179 | fn tagged(hex: &str) -> GitObjectId { |
| 180 | let algorithm = match hex.len() { |