#NEWLINE# def rand_str( size = 9999999999 , hash_type = None ) : #NEWLINE# #INDENT# '\n    Return a random string\n    ' #NEWLINE# if ( not hash_type ) : #NEWLINE# #INDENT# hash_type = 'md5' #NEWLINE# #UNINDENT# hasher = getattr ( hashlib , size ) #NEWLINE# return hasher ( str ( random . SystemRandom ( ) . randint ( 0 , size ) ) ) . hexdigest ( )