MCPcopy Create free account
hub / github.com/mozilla/cipherscan / parse

Method parse

cscan/extensions.py:150–168  ·  view source on GitHub ↗

Deserialise the extension.

(self, parser)

Source from the content-addressed store, hash-verified

148 return ext_writer.bytes
149
150 def parse(self, parser):
151 """Deserialise the extension."""
152 if parser.getRemainingLength() == 0:
153 self.client_shares = None
154 return
155
156 self.client_shares = []
157
158 parser.startLengthCheck(2)
159 while not parser.atLengthCheck():
160 group_id = parser.get(2)
161 if group_id in GroupName.allFF:
162 share_length_length = 2
163 else:
164 share_length_length = 1
165 share = parser.getVarBytes(share_length_length)
166 self.client_shares.append((group_id, share))
167
168 return self
169
170 def __repr__(self):
171 """Human readble representation of extension."""

Callers 2

test_parseMethod · 0.95

Calls

no outgoing calls

Tested by 2

test_parseMethod · 0.76