go-rfc2234/hexdigit.go

9 lines
288 B
Go
Raw Normal View History

2023-10-04 08:37:18 +00:00
package rfc2234
// IsHexDigit returns true if value of 'r' matches 'ALPHA' as defined in IETF RFC-2234:
//
// HEXDIGIT = %30-%39 / %41-%46 / %61-%66 ; 0-9 / A-F / a-f
func IsHexDigit(r rune) bool {
return ('0' <= r && r <= '9') || ('A' <= r && r <= 'F') || ('a' <= r && r <= 'f')
}