def encode(self, num):
        """ Encode a simple number, using a perfect hash and converting to a 
            more user friendly string of characters.
        """
        # Check the number is within our working range
        if num < 0: return None

        size = self.get_size(num)
        hash = self.perfect_hash(num, size)
        return self.friendly_string(hash, size)
dataset/ETHPy150Open willhardy/Roll-Your-Own/rollyourown/commerce/utils/friendly_id.py/FriendlyID.encode/original