Parsing short hexadecimal strings efficiently

Parsing short hexadecimal strings efficiently

We sometimes want to convert strings of hexadecimal characters into a numerical value. Each character is represented as a byte value using its corresponding ASCII code point. I implemented both of these and I find that the table lookup approach is more than twice as fast when the function is called frequently.

Source: lemire.me