MCPcopy Create free account
hub / github.com/doraemonext/wechat-python-sdk / _encrypt_response

Method _encrypt_response

wechat_sdk/basic.py:868–875  ·  view source on GitHub ↗
(self, response)

Source from the content-addressed store, hash-verified

866 raise OfficialAPIError(errcode=json_data.get('errcode'), errmsg=json_data.get('errmsg', ''))
867
868 def _encrypt_response(self, response):
869 if self.conf.encrypt_mode == 'safe':
870 return self.conf.crypto.encrypt_message(
871 msg=to_binary(response),
872 nonce=generate_nonce(),
873 timestamp=generate_timestamp(),
874 )
875 return response

Callers 8

response_noneMethod · 0.95
response_textMethod · 0.95
response_imageMethod · 0.95
response_voiceMethod · 0.95
response_videoMethod · 0.95
response_musicMethod · 0.95
response_newsMethod · 0.95

Calls 4

to_binaryFunction · 0.85
generate_nonceFunction · 0.85
generate_timestampFunction · 0.85
encrypt_messageMethod · 0.45

Tested by

no test coverage detected