MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / git_oid_hex

Function git_oid_hex

atomic-repository/src/repository/synthesis.rs:303–311  ·  view source on GitHub ↗

Lowercase hex of a tagged Git object ID.

(oid: &GitObjectId)

Source from the content-addressed store, hash-verified

301
302/// Lowercase hex of a tagged Git object ID.
303pub(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).
314pub(crate) fn git_algorithm_label(algorithm: GitHashAlgorithm) -> &'static str {

Callers 6

prepareMethod · 0.70
unhashed_git_factsMethod · 0.70
resolve_git_shaMethod · 0.70
index_replayed_git_spanFunction · 0.70

Calls 3

lenMethod · 0.45
as_bytesMethod · 0.45
pushMethod · 0.45