#identity #did #parse-url #decentralized-identity #decentralized-identifier

no-std did_url_parser

A no_std parser for Decentralized Identifiers (DIDs)

1 unstable release

0.2.0 Mar 26, 2024

#1825 in Parser implementations

Download history 792/week @ 2024-07-27 857/week @ 2024-08-03 1182/week @ 2024-08-10 1775/week @ 2024-08-17 948/week @ 2024-08-24 887/week @ 2024-08-31 794/week @ 2024-09-07 553/week @ 2024-09-14 614/week @ 2024-09-21 650/week @ 2024-09-28 652/week @ 2024-10-05 915/week @ 2024-10-12 414/week @ 2024-10-19 445/week @ 2024-10-26 731/week @ 2024-11-02 488/week @ 2024-11-09

2,248 downloads per month
Used in 11 crates (2 directly)

MIT/Apache

30KB
746 lines

DID URL Parser

A parser for Decentralized Identifiers (DIDs)

A fork of l1h3r/did_url.


use did_url_parser::DID;

let did = DID::parse("did:example:alice")?;

// Prints Method = example
println!("Method = {}", did.method());

// Prints Method Id = alice
println!("Method Id = {}", did.method_id());

// Prints DID = did:example:alice
println!("DID = {}", did);

// Prints Joined = did:example:alice?query=true#key-1
println!("Joined = {}", did.join("#key-1")?.join("?query=true")?);

References


License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~190KB