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

Function try_decode_hex_char

datafusion/sql/src/expr/value.rs:333–340  ·  view source on GitHub ↗

Try to decode a byte from a hex char. None will be returned if the input char is hex-invalid.

(c: u8)

Source from the content-addressed store, hash-verified

331///
332/// None will be returned if the input char is hex-invalid.
333const fn try_decode_hex_char(c: u8) -> Option<u8> {
334 match c {
335 b'A'..=b'F' => Some(c - b'A' + 10),
336 b'a'..=b'f' => Some(c - b'a' + 10),
337 b'0'..=b'9' => Some(c - b'0'),
338 _ => None,
339 }
340}
341
342/// Returns None if the value can't be converted to i256.
343/// Modified from <https://github.com/apache/arrow-rs/blob/c4dbf0d8af6ca5a19b8b2ea777da3c276807fc5e/arrow-buffer/src/bigint/mod.rs#L303>

Callers 1

try_decode_hex_literalFunction · 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…