MCPcopy
hub / github.com/wechatpy/wechatpy / encode

Method encode

wechatpy/crypto/pkcs7.py:10–16  ·  view source on GitHub ↗
(cls, text)

Source from the content-addressed store, hash-verified

8
9 @classmethod
10 def encode(cls, text):
11 length = len(text)
12 padding_count = cls.block_size - length % cls.block_size
13 if padding_count == 0:
14 padding_count = cls.block_size
15 padding = to_binary(chr(padding_count))
16 return text + padding * padding_count
17
18 @classmethod
19 def decode(cls, decrypted):

Callers 11

check_wxa_signatureFunction · 0.80
to_binaryFunction · 0.80
_requestMethod · 0.80
_requestMethod · 0.80
_requestMethod · 0.80
get_jsapi_card_paramsMethod · 0.80
_encryptMethod · 0.80
_encryptMethod · 0.80
calculate_signature_hmacFunction · 0.80
_requestMethod · 0.80

Calls 1

to_binaryFunction · 0.90

Tested by 1