def bitshuffle_decode(data, itemsize=1, blocksize=0, out=None): """Bitunshuffle.""" if isinstance(data, numpy.ndarray): return bitshuffle.bitunshuffle(data, blocksize) data = numpy.frombuffer(data, dtype=f'uint{itemsize * 8}') data = bitshuffle.bitunshuffle(data, blocksize) return data.tobytes()
def buff_unshuffle(buff): buff = numpy.frombuffer(buff) buff = bitshuffle.bitunshuffle(buff).tostring() return buff