MCPcopy Create free account
hub / github.com/Bitmessage/PyBitmessage / _unpack_binary

Function _unpack_binary

src/fallback/umsgpack/umsgpack.py:673–683  ·  view source on GitHub ↗
(code, fp, options)

Source from the content-addressed store, hash-verified

671
672
673def _unpack_binary(code, fp, options):
674 if code == b'\xc4':
675 length = struct.unpack("B", _read_except(fp, 1))[0]
676 elif code == b'\xc5':
677 length = struct.unpack(">H", _read_except(fp, 2))[0]
678 elif code == b'\xc6':
679 length = struct.unpack(">I", _read_except(fp, 4))[0]
680 else:
681 raise Exception("logic error, not binary: 0x%02x" % ord(code))
682
683 return _read_except(fp, length)
684
685
686def _unpack_ext(code, fp, options):

Callers

nothing calls this directly

Calls 1

_read_exceptFunction · 0.85

Tested by

no test coverage detected