Lowercase hex of a tagged Git object ID.
(oid: &GitObjectId)
| 301 | |
| 302 | /// Lowercase hex of a tagged Git object ID. |
| 303 | pub(crate) fn git_oid_hex(oid: &GitObjectId) -> String { |
| 304 | const HEX: &[u8; 16] = b"0123456789abcdef"; |
| 305 | let mut out = String::with_capacity(oid.as_bytes().len() * 2); |
| 306 | for byte in oid.as_bytes() { |
| 307 | out.push(HEX[(byte >> 4) as usize] as char); |
| 308 | out.push(HEX[(byte & 0x0f) as usize] as char); |
| 309 | } |
| 310 | out |
| 311 | } |
| 312 | |
| 313 | /// Lowercase name of a Git hash algorithm (unhashed provenance tag). |
| 314 | pub(crate) fn git_algorithm_label(algorithm: GitHashAlgorithm) -> &'static str { |