From 9cb740764b232fbdf585639f39e096cb5ce45891 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sat, 2 Mar 2024 07:48:24 -0300 Subject: [PATCH] nip05: IsValidIdentifier --- nip05/nip05.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nip05/nip05.go b/nip05/nip05.go index f2551e2..18bc00e 100644 --- a/nip05/nip05.go +++ b/nip05/nip05.go @@ -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 {