blob: 6e957303ee2a85f2ca3f3f5b04b235358e06f47c [file] [log] [blame]
package bencode
import (
"strings"
"unicode"
)
func isValidTag(key string) bool {
if key == "" {
return false
}
for _, c := range key {
if c != '$' && c != '-' && c != '_' && !unicode.IsLetter(c) && !unicode.IsDigit(c) {
return false
}
}
return true
}
func matchName(key string) func(string) bool {
return func(s string) bool {
return strings.ToLower(key) == strings.ToLower(s)
}
}