Speed hack because hex_encode/decode is expensive