MCPcopy Create free account
hub / github.com/RustCrypto/utils / next_byte

Function next_byte

hex-literal/src/lib.rs:25–35  ·  view source on GitHub ↗
(string: &[u8], pos: usize)

Source from the content-addressed store, hash-verified

23}
24
25const fn next_byte(string: &[u8], pos: usize) -> Option<(u8, usize)> {
26 let (half1, pos) = match next_hex_char(string, pos) {
27 Some(v) => v,
28 None => return None,
29 };
30 let (half2, pos) = match next_hex_char(string, pos) {
31 Some(v) => v,
32 None => panic!("Odd number of hex characters"),
33 };
34 Some(((half1 << 4) + half2, pos))
35}
36
37/// Compute length of a byte array which will be decoded from the strings.
38///

Callers 2

lenFunction · 0.85
decodeFunction · 0.85

Calls 1

next_hex_charFunction · 0.85

Tested by

no test coverage detected