import bcd2char() and char2bcd() from OpenBSC
diff --git a/include/osmocore/utils.h b/include/osmocore/utils.h
index cf3b460..51c6f03 100644
--- a/include/osmocore/utils.h
+++ b/include/osmocore/utils.h
@@ -13,5 +13,8 @@
 const char *get_value_string(const struct value_string *vs, uint32_t val);
 int get_string_value(const struct value_string *vs, const char *str);
 
+char bcd2char(uint8_t bcd);
+/* only works for numbers in ascci */
+uint8_t char2bcd(char c);
 
 #endif
diff --git a/src/utils.c b/src/utils.c
index 0d878c7..2a73d39 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -30,3 +30,17 @@
 	}
 	return -EINVAL;
 }
+
+char bcd2char(uint8_t bcd)
+{
+	if (bcd < 0xa)
+		return '0' + bcd;
+	else
+		return 'A' + (bcd - 0xa);
+}
+
+/* only works for numbers in ascci */
+uint8_t char2bcd(char c)
+{
+	return c - 0x30;
+}