Skip to main content

hex_node_id_to_encoded_peer_id

Function hex_node_id_to_encoded_peer_id 

Source
pub fn hex_node_id_to_encoded_peer_id(hex_id: &str) -> Result<EncodedPeerId>
Expand description

Convert a hex-encoded 32-byte node ID to an EncodedPeerId.

Peer IDs are 64-character hex strings representing 32 raw bytes. This function decodes the hex string and wraps the raw bytes directly into an EncodedPeerId.

ยงErrors

Returns an error if the hex string is invalid or not exactly 32 bytes.