identity_core 0.1.0

An implementation of the Decentralized Identifiers (DID) standard
Documentation
pct_encoded = { "%" ~ ASCII_HEX_DIGIT ~ ASCII_HEX_DIGIT }
shard_char = { path_char | "/" | "?" }
path_char = { ASCII_ALPHA | ASCII_DIGIT | "-" | "." | "_" | 
              "!" | "~" | "$" | "&" | "'" | "(" | ")" | "*" | "+" |
              ";" | "," | "=" | ":" | "@" | pct_encoded}

path_segment = { path_char* }

query_char = { shard_char }
query = { query_char* }

fragment_char = { shard_char }
fragment = { fragment_char* }

method_char = { ASCII_ALPHA_LOWER | ASCII_DIGIT }
method_name = { method_char* }

id_segment_char = { ASCII_ALPHA | ASCII_DIGIT | "." | "-" | "_" }
id_segment = { id_segment_char* }

param_char    = { ASCII_ALPHA | ASCII_DIGIT | "." | "-" | "_" | ":" |
                  pct_encoded }
param_name    = { param_char+ }
param_value   = { param_char* }
param         = { param_name ~  ("=" ~ param_value)? }

did = _{"did:" ~ method_name ~ ":" ~ (id_segment ~ (":" ~ id_segment)*) ~
        (";" ~ param)* ~
        ("/" ~ path_segment)* ~
        ("?" ~ query)? ~
        ("#" ~ fragment)? }