Convert between binary, octal, decimal and hex — plus the bit tricks that show up in LeetCode problems.