How to use the s2protocol.decoders.BitPackedBuffer function in s2protocol

To help you get started, we’ve selected a few s2protocol examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github karlgluck / heroes-of-the-storm-replay-parser / s2protocol / decoders.py View on Github external
def __init__(self, contents, typeinfos):
        self._buffer = BitPackedBuffer(contents)
        self._typeinfos = typeinfos
github karlgluck / heroes-of-the-storm-replay-parser / s2protocol / decoders.py View on Github external
def __init__(self, contents, typeinfos):
        self._buffer = BitPackedBuffer(contents)
        self._typeinfos = typeinfos
github karlgluck / heroes-of-the-storm-replay-parser / s2protocol / decoders.py View on Github external
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))
github karlgluck / heroes-of-the-storm-replay-parser / s2protocol / decoders.py View on Github external
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))
github karlgluck / heroes-of-the-storm-replay-parser / s2protocol / decoders.py View on Github external
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))
github Blizzard / s2protocol / s2protocol / decoders.py View on Github external
def __init__(self, contents, typeinfos):
        self._buffer = BitPackedBuffer(contents)
        self._typeinfos = typeinfos
github karlgluck / heroes-of-the-storm-replay-parser / s2protocol / decoders.py View on Github external
def __init__(self, contents, typeinfos):
        self._buffer = BitPackedBuffer(contents)
        self._typeinfos = typeinfos
        self._markers = []
        self._json = {}
github Blizzard / s2protocol / s2protocol / decoders.py View on Github external
def __init__(self, contents, typeinfos):
        self._buffer = BitPackedBuffer(contents)
        self._typeinfos = typeinfos