We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ba4f966 commit f55e596Copy full SHA for f55e596
sogs/utils.py
@@ -8,16 +8,19 @@
8
import json
9
from typing import Union, Tuple
10
11
+
12
def parse_message(data: bytes):
13
"""given a bunch of bytes for a protobuf message return the entire parsed message"""
14
msg = protobuf.Content()
15
msg.ParseFromString(remove_session_message_padding(data))
16
return msg
17
18
19
def message_body(data: bytes):
20
"""given a bunch of bytes for a protobuf message return the message's body"""
21
return parse_message(data).body
22
23
24
def encode_base64(data: bytes):
25
return base64.b64encode(data).decode()
26
0 commit comments