nip05: IsValidIdentifier

This commit is contained in:
fiatjaf 2024-03-02 07:48:24 -03:00
parent f4cf242084
commit 9cb740764b
No known key found for this signature in database
GPG Key ID: BAD43C4BE5C1A3A1

View File

@ -19,6 +19,10 @@ type WellKnownResponse struct {
NIP46 map[string][]string `json:"nip46,omitempty"`
}
func IsValidIdentifier(input string) bool {
return NIP05_REGEX.MatchString(input)
}
func ParseIdentifier(fullname string) (name string, domain string, err error) {
res := NIP05_REGEX.FindStringSubmatch(fullname)
if len(res) == 0 {