From b81a2f8452e0d1d2fe8fbe479c1ae8d05b010199 Mon Sep 17 00:00:00 2001 From: Rockingcool Date: Sun, 19 Jan 2025 21:31:18 -0600 Subject: [PATCH] Added functions to find if a character is a valid hex value and a valid octal value --- misc.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/misc.go b/misc.go index eb5c75c..30f0e95 100644 --- a/misc.go +++ b/misc.go @@ -131,3 +131,11 @@ func expandSlice[T any](slc []T, newSize int) []T { copy(toRet, slc) return toRet } + +func isHex(c rune) bool { + return slices.Contains([]rune("0123456789abcdefABCDEF"), c) +} + +func isOctal(c rune) bool { + return slices.Contains([]rune("01234567"), c) +}