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

Method to_hex

atomic-repository/src/git_binding/codec.rs:125–130  ·  view source on GitHub ↗

Lowercase hex encoding, as used in Git refs and messages.

(&self)

Source from the content-addressed store, hash-verified

123
124 /// Lowercase hex encoding, as used in Git refs and messages.
125 pub fn to_hex(&self) -> String {
126 self.as_bytes()
127 .iter()
128 .map(|byte| format!("{byte:02x}"))
129 .collect()
130 }
131
132 /// Parse from lowercase hex (40 or 64 characters).
133 pub fn from_hex(hex: &str) -> Result<Self, BindingEncodeError> {

Calls 3

collectMethod · 0.45
iterMethod · 0.45
as_bytesMethod · 0.45