package crypt import ( "regexp" ) var uuidRegex = regexp.MustCompile(`^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$`) func IsValidUUID(u string) bool { return uuidRegex.MatchString(u) } func IsValidHexColor(s string) bool { return regexp.MustCompile(`^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$`).MatchString(s) } func ValidatePassword(password string) bool { n := len([]rune(password)) return n >= 8 && n <= 128 }