Unfortunately, the multiplication makes this solution also not bitwise operation only.

Anyway, I have changed my mind about the original implementation. Given that the input is a string, not a hexadecimal integer, I prefer fixing the string using your regex over the awkward bunch of bitwise operators.