def pad_to(data, alignment, pad_character='\xff'):
 pad_mod = (len(data) % alignment)
 if (pad_mod != 0):
  data += (pad_character * (alignment - pad_mod))
 return data

def pad_to ( data , alignment , pad_character = '\xff' ) : pad_mod = ( len ( data ) % alignment ) if ( pad_mod != 0 ) : data += ( pad_character * ( alignment - pad_mod ) ) return data
pad to the next alignment boundary .