created dns api but no testing yet

This commit is contained in:
afeiszli
2021-04-26 23:39:15 -04:00
parent f6d07176c5
commit 482c8616aa
6 changed files with 516 additions and 2 deletions

View File

@@ -446,6 +446,19 @@ func NameInNetworkCharSet(name string) bool {
return true
}
func NameInDNSCharSet(name string) bool {
charset := "abcdefghijklmnopqrstuvwxyz1234567890-."
for _, char := range name {
if !strings.Contains(charset, strings.ToLower(string(char))) {
return false
}
}
return true
}
func NameInNodeCharSet(name string) bool {
charset := "abcdefghijklmnopqrstuvwxyz1234567890-"