MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / encode

Function encode

nodedb/src/control/otel/receiver.rs:412–419  ·  view source on GitHub ↗
(bytes: &[u8])

Source from the content-addressed store, hash-verified

410/// Minimal hex encoding for trace/span IDs (avoids adding `hex` crate).
411mod hex {
412 pub fn encode(bytes: &[u8]) -> String {
413 let mut s = String::with_capacity(bytes.len() * 2);
414 for &b in bytes {
415 s.push(HEX_CHARS[(b >> 4) as usize]);
416 s.push(HEX_CHARS[(b & 0xf) as usize]);
417 }
418 s
419 }
420 const HEX_CHARS: [char; 16] = [
421 '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f',
422 ];

Callers 8

span_to_ilpFunction · 0.70
log_to_ilpFunction · 0.70
spawn_metrics_exporterFunction · 0.70
export_spanFunction · 0.70
snapshot_remoteFunction · 0.50
dispatch_remoteFunction · 0.50
dispatch_remoteFunction · 0.50

Calls 2

lenMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected