def newid(length=16):
 l = int(math.ceil(((float(length) * 6.0) / 8.0)))
 return base64.b64encode(os.urandom(l))[:length].decode('ascii')

def newid ( length = 16 ) : l = int ( math . ceil ( ( ( float ( length ) * 6.0 ) / 8.0 ) ) ) return base64 . b64encode ( os . urandom ( l ) ) [ : length ] . decode ( 'ascii' )
generate a new random string id .