def append_PKCS7_padding(b):
 numpads = (16 - (len(b) % 16))
 return (b + (numpads * bytes(chr(numpads), encoding=u'ascii')))

def append_PKCS7_padding ( b ) : numpads = ( 16 - ( len ( b ) % 16 ) ) return ( b + ( numpads * bytes ( chr ( numpads ) , encoding = u'ascii' ) ) )
function to pad the given data to a multiple of 16-bytes by pkcs7 padding .