Parse hex / base64 (as much as possible).