Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, contents, typeinfos):
self._buffer = BitPackedBuffer(contents)
self._typeinfos = typeinfos
def __init__(self, contents, typeinfos):
self._buffer = BitPackedBuffer(contents)
self._typeinfos = typeinfos
def peek_bytes_as_bin_string(self, bytes=0):
if bytes == 0:
bytes = len(self._data)
bpb = BitPackedBuffer([], self._bigendian)
bpb.copy(self)
return ''.join('{:08b}'.format(ord(x)) for x in bpb.read_unaligned_bytes(bytes))
def peek_bytes_as_hex_string(self, bytes=0):
if bytes == 0:
bytes = len(self._data)
bpb = BitPackedBuffer([], self._bigendian)
bpb.copy(self)
return ''.join('{:02x}'.format(ord(x)) for x in bpb.read_unaligned_bytes(bytes))
def peek_bits_as_bin_string(self, bits=0):
if bits == 0:
bits = len(self._data) * 8
bpb = BitPackedBuffer([], self._bigendian)
bpb.copy(self)
return ('{:0%ib}'%bits).format(bpb.read_bits(bits))
def __init__(self, contents, typeinfos):
self._buffer = BitPackedBuffer(contents)
self._typeinfos = typeinfos
def __init__(self, contents, typeinfos):
self._buffer = BitPackedBuffer(contents)
self._typeinfos = typeinfos
self._markers = []
self._json = {}
def __init__(self, contents, typeinfos):
self._buffer = BitPackedBuffer(contents)
self._typeinfos = typeinfos