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

Function token_to_hex

nodedb-cluster/src/auth/join_token.rs:78–85  ·  view source on GitHub ↗

Encode raw token bytes as a lowercase hex string.

(bytes: &[u8])

Source from the content-addressed store, hash-verified

76
77/// Encode raw token bytes as a lowercase hex string.
78pub fn token_to_hex(bytes: &[u8]) -> String {
79 use std::fmt::Write as _;
80 let mut out = String::with_capacity(bytes.len() * 2);
81 for b in bytes {
82 let _ = write!(out, "{b:02x}");
83 }
84 out
85}
86
87/// Compute SHA-256 of the token bytes. Used as the stable identity for
88/// state-machine tracking (never stores the raw token).

Callers 1

issue_tokenFunction · 0.85

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected