Created
April 22, 2026 13:24
-
-
Save alanshaw/111b312a319b36defa406bc9b4741d4e to your computer and use it in GitHub Desktop.
Generate a DID with a particular suffix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "strings" | |
| "github.com/alanshaw/ucantone/principal/ed25519" | |
| "github.com/alanshaw/ucantone/principal/signer" | |
| ) | |
| func main() { | |
| for { | |
| s, err := ed25519.Generate() | |
| if err != nil { | |
| panic(err) | |
| } | |
| did := s.DID().String() | |
| suffix := strings.ToLower(did[len(did)-3:]) | |
| fmt.Println(suffix) | |
| if suffix == "svc" { | |
| fmt.Println(did) | |
| fmt.Println(signer.Format(s)) | |
| break | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment