I\'m trying to convert a hex char to integer as fast as possible.
char
This is only one line: int x = atoi(hex.c_str);
int x = atoi(hex.c_str);
Is there a faster way
This is my favorite hex-to-int code:
inline int htoi(int x) { return 9 * (x >> 6) + (x & 017); }
It is case-insensitive for letter, i.e will return correct result for "a" and "A".