Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/l1h3r/did_url
A parser for Decentralized Identifiers (DIDs)
https://github.com/l1h3r/did_url
Last synced: 11 days ago
JSON representation
A parser for Decentralized Identifiers (DIDs)
- Host: GitHub
- URL: https://github.com/l1h3r/did_url
- Owner: l1h3r
- License: apache-2.0
- Created: 2020-10-13T21:39:52.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-01T15:07:40.000Z (over 1 year ago)
- Last Synced: 2024-10-31T11:40:56.607Z (17 days ago)
- Language: Rust
- Size: 39.1 KB
- Stars: 1
- Watchers: 2
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# did
**A parser for Decentralized Identifiers (DIDs)**
---
```rust
use did_url::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
- [DID Syntax](https://www.w3.org/TR/did-core/#did-syntax)
- [DID Url Syntax](https://www.w3.org/TR/did-core/#did-url-syntax)
- [DID Parameters](https://www.w3.org/TR/did-core/#did-parameters)
- [Path](https://www.w3.org/TR/did-core/#path)
- [Query](https://www.w3.org/TR/did-core/#query)
- [Fragment](https://www.w3.org/TR/did-core/#fragment)
- [Relative DID Urls](https://www.w3.org/TR/did-core/#relative-did-urls)
#### 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.