Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def unpack(self, payload, offset, length):
res, offset, length = self._unpack_members(payload, offset, length)
res['preamble'] = self.preamble
res['msg_type'] = self.msg_type
res['sender'] = self.sender
if self.payload is not None:
res['payload'] = standard_b64encode(self.payload.tobytes()).decode('ascii')
res['crc'] = self.crc
res['length'] = self.length
return res, offset, length