Files

14 lines
335 B
Go
Raw Permalink Normal View History

package deviceconfig
import (
"strings"
"unicode"
"unicode/utf8"
)
// Empty restores the default label. The byte limit fits the firmware NVS buffer.
func ValidDisplayName(name string) bool {
return len(name) <= 96 && utf8.ValidString(name) && strings.TrimSpace(name) == name &&
strings.IndexFunc(name, unicode.IsControl) < 0
}