use hexlify from binascii
make tests pass in py2