Added toHexstring to convert a bitstring to a hexstring