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

no-std did_url_parser

A no_std parser for Decentralized Identifiers (DIDs)

2 unstable releases

new 0.3.0 Jan 6, 2025
0.2.0 Mar 26, 2024

#538 in Parser implementations

Download history 546/week @ 2024-09-18 659/week @ 2024-09-25 557/week @ 2024-10-02 884/week @ 2024-10-09 612/week @ 2024-10-16 404/week @ 2024-10-23 587/week @ 2024-10-30 644/week @ 2024-11-06 609/week @ 2024-11-13 1068/week @ 2024-11-20 1122/week @ 2024-11-27 1254/week @ 2024-12-04 1288/week @ 2024-12-11 590/week @ 2024-12-18 232/week @ 2024-12-25 713/week @ 2025-01-01

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

MIT/Apache

30KB
758 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

~185KB