def hash(self, raw: Any) -> str:
        """
        Returns the hex digest of a HMAC-encoded version of the input.
        """
        with MultiTimerContext(timer, TIMING_HASH):
            raw_bytes = str(raw).encode('utf-8')
            hmac_obj = hmac.new(key=self.key_bytes, msg=raw_bytes,
                                digestmod=self.digestmod)
            return hmac_obj.hexdigest()
Returns the hex digest of a HMAC-encoded version of the input.