Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for . (dot) and - (minus) charaters in did ethr-network (method-specific-id) #47

Open
PeterTheOne opened this issue Aug 14, 2020 · 0 comments

Comments

@PeterTheOne
Copy link

PeterTheOne commented Aug 14, 2020

There are some regular expression that only allow \\w (ALPHA / DIGIT / "_") in the the ethr-network part of the ethr-did.

Examples I found:

"^(did:)?((\\w+):)?((\\w+):)?((0x)([0-9a-fA-F]{40}))".toRegex()

private val identityExtractPattern = "^did:ethr:((\\w+):)?(0x[0-9a-fA-F]{40})".toRegex()

private val didParsePattern = "^(did:)?((\\w+):)?((\\w+):)?(0x[0-9a-fA-F]{40})".toRegex()

Although the ethr-method only specifies a fixed set of networks in its spec, the more general did-core allows for ALPHA / DIGIT / "." / "-" / "_". I want this lib to be future proof for new networks with dot and minus in their network name!

I'm planning to add a network to the spec if a - in the name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant