Skip to main content

try_parse_cid

Function try_parse_cid 

Source
pub fn try_parse_cid(s: &str) -> Option<Cid>
Expand description

Parses s as a CID, returning None if it is not a valid CID string.

Accepts CIDv0 and multibase CID strings up to MAX_CID_STRING_LEN. Paths, non-minimal binary encodings, and trailing decoded bytes are rejected.