Add hex encoding and decoding