summaryrefslogtreecommitdiff
path: root/2004/i/nono/src/utils/hexa.cc
diff options
context:
space:
mode:
Diffstat (limited to '2004/i/nono/src/utils/hexa.cc')
-rw-r--r--2004/i/nono/src/utils/hexa.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/2004/i/nono/src/utils/hexa.cc b/2004/i/nono/src/utils/hexa.cc
index 236342b..d5e4716 100644
--- a/2004/i/nono/src/utils/hexa.cc
+++ b/2004/i/nono/src/utils/hexa.cc
@@ -63,6 +63,17 @@ digit2hex (int d)
return digit2hexTbl_[d];
}
+/// Décode un mot non-signé (1 octets).
+unsigned int
+hexUnsignedChar2int (const char *s)
+{
+ int h1 = hex2digit (s[0]);
+ int h0 = hex2digit (s[1]);
+ if (h1 == hexInvalid || h0 == hexInvalid)
+ return hexInvalid;
+ return (unsigned char) (h1 << 4 | h0);
+}
+
/// Décode un mot signé (1 octets).
int
hexSignedChar2int (const char *s)