MCPcopy Index your code
hub / github.com/offu/WeRoBot / to_binary

Function to_binary

werobot/utils.py:61–66  ·  view source on GitHub ↗
(value, encoding="utf-8")

Source from the content-addressed store, hash-verified

59
60
61def to_binary(value, encoding="utf-8") -> bytes:
62 if isinstance(value, bytes):
63 return value
64 if isinstance(value, str):
65 return value.encode(encoding)
66 return bytes(value)
67
68
69def is_string(value) -> bool:

Callers 14

get_replyMethod · 0.90
__init__Method · 0.90
encryptMethod · 0.90
decryptMethod · 0.90
__init__Method · 0.90
encodeFunction · 0.90
__init__Method · 0.90
test_wechat_replyFunction · 0.90
test_articleFunction · 0.90
remove_sessionFunction · 0.90
test_prpcryptoFunction · 0.90
test_message_cryptFunction · 0.90

Calls

no outgoing calls

Tested by 6

test_wechat_replyFunction · 0.72
test_articleFunction · 0.72
remove_sessionFunction · 0.72
test_prpcryptoFunction · 0.72
test_message_cryptFunction · 0.72
test_to_binaryFunction · 0.72