MCPcopy Create free account
hub / github.com/apache/datafusion / hex_nibble

Function hex_nibble

datafusion/spark/src/function/math/unhex.rs:73–80  ·  view source on GitHub ↗
(c: u8)

Source from the content-addressed store, hash-verified

71
72#[inline]
73fn hex_nibble(c: u8) -> Option<u8> {
74 match c {
75 b'0'..=b'9' => Some(c - b'0'),
76 b'a'..=b'f' => Some(c - b'a' + 10),
77 b'A'..=b'F' => Some(c - b'A' + 10),
78 _ => None,
79 }
80}
81
82/// Decodes a hex-encoded byte slice into binary data.
83/// Returns `true` if decoding succeeded, `false` if the input contains invalid hex characters.

Callers 1

unhex_commonFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…