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

Function decode_hex

atomic-cli/tests/it/git_import_cb9a_test.rs:172–177  ·  view source on GitHub ↗

Lowercase-hex decode (test helper; the hex crate is not a dependency).

(hex: &str)

Source from the content-addressed store, hash-verified

170
171/// Lowercase-hex decode (test helper; the hex crate is not a dependency).
172fn 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
179fn tagged(hex: &str) -> GitObjectId {
180 let algorithm = match hex.len() {

Callers 1

taggedFunction · 0.70

Calls 3

collectMethod · 0.45
lenMethod · 0.45
unwrapMethod · 0.45

Tested by

no test coverage detected