def bytes_leading(raw_bytes, needle=ZERO_BYTE):
    leading = 0
    # Indexing keeps compatibility between Python 2.x and Python 3.x
    _byte = needle[0]
    for x in raw_bytes:
        if x == _byte:
            leading += 1
        else:
            break
    return leading
Optimises attached experiment of simulation.
dataset/ETHPy150Open CouchPotato/CouchPotatoServer/libs/rsa/transform.py/bytes_leading--crossover with--dataset/ETHPy150Open michaelhush/M-LOOP/mloop/controllers.py/NelderController.runOptimization