MCPcopy Create free account
hub / github.com/TheAlgorithms/Rust / base16_decode

Function base16_decode

src/ciphers/base16.rs:78–112  ·  view source on GitHub ↗

Decodes base16 (hexadecimal) encoded data into bytes. This function validates the input according to RFC 3548 Section 6: - The data must have an even number of characters - The data must only contain uppercase hexadecimal characters (0-9, A-F) # Arguments `data` - A string slice containing uppercase hexadecimal characters # Returns `Ok(Vec )` - Successfully decoded bytes `Err(String)` - Er

(data: &str)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 7

test_decode_odd_lengthFunction · 0.85
test_decode_mixed_caseFunction · 0.85
test_roundtripFunction · 0.85
test_roundtrip_all_bytesFunction · 0.85
test_roundtrip_emptyFunction · 0.85

Calls 2

pushMethod · 0.80
lenMethod · 0.45

Tested by 7

test_decode_odd_lengthFunction · 0.68
test_decode_mixed_caseFunction · 0.68
test_roundtripFunction · 0.68
test_roundtrip_all_bytesFunction · 0.68
test_roundtrip_emptyFunction · 0.68