Return a hash of the tuple of indices that specify the group

def get_id(self, grp):
        """
        Return a hash of the tuple of indices that specify the group
        """
        thehash = hex(hash(grp))
        if ISPY3:  # use default encoding to get bytes
            thehash = thehash.encode()
        return self.cache.get(grp, hashlib.sha1(thehash).hexdigest())