blob: 3be4ef47e16552ea0ebb6bfa808e3b3592352de4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
#include "Utility.h"
int hex_to_int(char c) {
if (c >= '0' && c <= '9')
return c - '0';
if (c >= 'a' && c <= 'f')
return c - 'a' + 10;
if (c >= 'A' && c <= 'F')
return c - 'A' + 10;
return -1;
}
|