Convert hex using 16 bits (thanks @gurnec)