Simple hex string encoder/decoder