utils/int_conversions.py
def formatBin(x):  # FIXME: use ? Change name
    """ Add bits to get a byte and add spaces every 4 digits """
    n = len(x)
    r = n % 8
    if r != 0:
        k = 8 - r
        s = k * '0' + x
    else:
        s = x
    s = ' '.join(s[i:i + 4] for i in range(0, len(s), 4))
    return s
 Add bits to get a byte and add spaces every 4 digits 
Add bits to get a byte and add spaces every 4 digits
Add bits to get a byte and add spaces every 4 digits
def formatBin(x):  
    n = len(x)
    r = n % 8
    if r != 0:
        k = 8 - r
        s = k * '0' + x
    else:
        s = x
    s = ' '.join(s[i:i + 4] for i in range(0, len(s), 4))
    return s
def formatBin ( x ) : n = len ( x ) r = n % 8 if r != 0 : k = 8 - r s = k * '0' + x else : s = x s = ' ' . join ( s [ i : i + 4 ] for i in range ( 0 , len ( s ) , 4 ) ) return s
Add bits to get a byte and add spaces every 4 digits
Add bits to get a byte and add spaces every 4 digits
# FIXME: use ? Change name """ Add bits to get a byte and add spaces every 4 digits """
x