summaryrefslogtreecommitdiff
path: root/utils/utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'utils/utils.h')
-rw-r--r--utils/utils.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/utils/utils.h b/utils/utils.h
index 079708843..ffd4f2977 100644
--- a/utils/utils.h
+++ b/utils/utils.h
@@ -151,6 +151,16 @@ inline static char digit2lowcase_hex(unsigned char digit) {
return "0123456789abcdef"[digit];
}
+/**
+ * Return a hex digit for the given numerical value.
+ *
+ * \return character in range 0-9A-F
+ */
+inline static char digit2uppercase_hex(unsigned char digit) {
+ assert(digit < 16);
+ return "0123456789ABCDEF"[digit];
+}
+
/* Platform specific functions */
void die(const char * const error);