utils: add osmo_is_hexstr(), add unit test

Will be used by OsmoHLR to validate VTY and CTRL input.

Change-Id: Idf75946eb0a84e145adad13fc7c78bb7a267aa0a
diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h
index 855e653..5f41213 100644
--- a/include/osmocom/core/utils.h
+++ b/include/osmocom/core/utils.h
@@ -1,5 +1,7 @@
 #pragma once
 
+#include <stdbool.h>
+
 #include <osmocom/core/backtrace.h>
 #include <osmocom/core/talloc.h>
 
@@ -89,4 +91,7 @@
 
 size_t osmo_strlcpy(char *dst, const char *src, size_t siz);
 
+bool osmo_is_hexstr(const char *str, int min_digits, int max_digits,
+		    bool require_even);
+
 /*! @} */