def get_function_hash(self, func, args=None, kwargs=None, ttl=None, key=None, noc=None):
        """Compute the hash of the function to be evaluated.
        """

        base_hash = settings.HASH_FUNCTION()

        if PY3:
            base_hash.update(func.__name__.encode(settings.DEFAULT_ENCODING))
        else:
            base_hash.update(func.__name__)

        if args:
            for a in args:
                if PY3:
                    base_hash.update(repr(a).encode(settings.DEFAULT_ENCODING))
                else:
                    base_hash.update(repr(a))

        if kwargs:
            for k in sorted(kwargs):
                if PY3:
                    base_hash.update(("{}={}".format(k, repr(kwargs[k]))).encode(settings.DEFAULT_ENCODING))
                else:
                    base_hash.update(("{}={}".format(k, repr(kwargs[k]))))

        if ttl:
            base_hash.update(str(ttl).encode(settings.DEFAULT_ENCODING))

        if key and can_encrypt:
            if PY3:
                base_hash.update(key.encode(settings.DEFAULT_ENCODING))
            else:
                base_hash.update(key)

        if noc:
            base_hash.update(str(noc).encode(settings.DEFAULT_ENCODING))

        base_hash_hex = base_hash.hexdigest()

        return base_hash_hex
Compute the hash of the function to be evaluated.