Rewrite nibble_to_hex_digit for readability

Signed-off-by: Agathiyan Bragadeesh <agathiyan.bragadeesh2@arm.com>
diff --git a/library/x509.c b/library/x509.c
index b8a866a..b36e27a 100644
--- a/library/x509.c
+++ b/library/x509.c
@@ -812,7 +812,7 @@
 
 static char nibble_to_hex_digit(int i)
 {
-    return (i < 10) ? (i | 0x30) : ((i - 9) | 0x40);
+    return (i < 10) ? (i + '0') : (i - 10 + 'A');
 }
 
 /*