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

Function hex_encode

datafusion/spark/src/function/hash/sha2.rs:252–263  ·  view source on GitHub ↗
(data: T)

Source from the content-addressed store, hash-verified

250
251#[inline]
252fn hex_encode<T: AsRef<[u8]>>(data: T) -> String {
253 let bytes = data.as_ref();
254 let mut out = Vec::with_capacity(bytes.len() * 2);
255 for &b in bytes {
256 let hi = b >> 4;
257 let lo = b & 0x0F;
258 out.push(HEX_CHARS[hi as usize]);
259 out.push(HEX_CHARS[lo as usize]);
260 }
261 // SAFETY: out contains only ASCII
262 unsafe { String::from_utf8_unchecked(out) }
263}

Callers 2

invoke_with_argsMethod · 0.70
sha2_binary_bitlen_iterFunction · 0.70

Calls 3

as_refMethod · 0.45
lenMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…