code: def reverse_hash(hash, hex_format=True):
      
      if not hex_format:
          hash = hexlify(hash)
      return "".join(reversed([hash[i:i+2] for i in range(0, len(hash), 2)]))
docs: hash is in hex or binary format