def _pad_bytes_new(name, length):
    """
    Takes a bytes instance and pads it with null bytes until it's length chars.
    """
    if isinstance(name, str):
        name = bytes(name, 'utf-8')
    return name + b'\x00' * (length - len(name))
def _pad_bytes_new ( name , length ) : if isinstance ( name , str ) : name = bytes ( name , 'utf-8' ) return name + b'\x00' * ( length - len ( name ) )
Takes a bytes instance and pads it with null bytes until it's length chars.