Exemple #1
0
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()
Exemple #2
0
def buff_unshuffle(buff):
    buff = numpy.frombuffer(buff)
    buff = bitshuffle.bitunshuffle(buff).tostring()
    return buff