(self, msg, sign)
return json.loads(msg)
:raises: wechatpy.exceptions.InvalidSignatureException
:raises: wechatpy.exceptions.InvalidSignatureException
: raises : wechatpy . exceptions . InvalidSignatureException
def validate_message(self, msg, sign):
        """
        :raises: wechatpy.exceptions.InvalidSignatureException
        """
        str_to_sign = (msg + self.session_key).encode()
        server_sign = hashlib.sha1(str_to_sign).hexdigest()
        if server_sign != sign:
            raise InvalidSignatureException()
        return json.loads(msg)
def validate_message ( self , msg , sign ) : str_to_sign = ( msg + self . session_key ) . encode ( ) server_sign = hashlib . sha1 ( str_to_sign ) . hexdigest ( ) if server_sign != sign : raise InvalidSignatureException ( ) return json . loads ( msg )