mirror of
https://github.com/warmbly/warmbly.git
synced 2026-09-08 16:02:24 +00:00
16 lines
344 B
Go
16 lines
344 B
Go
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)
|
|
}
|