
Strange hex digit to integer trick; where do these constants come from? - querier_
https://github.com/gknowles/dimapp/blob/master/libs/core/util.h#L50,L54
======
schoen
Considering ASCII 'C', 'c', and '3', they have the binary expansions

    
    
      001000011
      001100011
      000110011
    

Notably, that third bit is what shows whether it's nibble value 8+3=11 or just
plain nibble value 3. The binary 11 that gives us the 3 is way over at the
right.

The way I would think of doing this in terms of bit operations is

(c & 7) | ((c&64)>>3)

However, they're apparently doing the (c&64)>>3 part with the multiplication
somehow and I haven't quite understood how that happens.

