name_to_did

Function name_to_did 

Source
pub fn name_to_did(name: &Name) -> String
Expand description

Encode an NDN Name as a did:ndn DID string.

The method-specific identifier is the base64url (no padding) encoding of the complete NDN Name TLV wire format, including the outer 07 <length> bytes.

let name: Name = "/com/acme/alice".parse().unwrap();
let did = name_to_did(&name);
assert!(did.starts_with("did:ndn:"));
// The method-specific-id is base64url — no colons, no v1: prefix.
assert!(!did["did:ndn:".len()..].contains(':'));