#NEWLINE# def random_salt_function( salt_len = 12 ) : #NEWLINE# #INDENT# '\n    Creates random salt for password.\n\n    :param salt_len: Length of salt. Default :data:`12`\n    :type param: :class:`int`\n\n    :return: Computed salt\n    :rtype: str\n    ' #NEWLINE# charset = 'abcdefghijklmnopqrstuxyz' #NEWLINE# charset = ( ( charset + charset . upper ( ) ) + '1234567890' ) #NEWLINE# chars = [ ] #NEWLINE# rand = SystemRandom ( ) #NEWLINE# for _ in range ( salt_len ) : #NEWLINE# #INDENT# chars . append ( rand . choice ( charset ) ) #NEWLINE# #UNINDENT# return '' . join ( chars )