Return to Snippet

Revision: 27931
at June 27, 2010 05:55 by allistera


Initial Code
def generatePassword(length = 10, using = "123456789qwertyuioplkjhgfdsazxcvbnm!£$%^&*()_+-=:@?><"):
	random.seed()
	password = ""
	for i in range(0, length):
		password = password + using[random.randrange(0, len(using))]
	return password

Initial URL

                                

Initial Description
Example Usage:
========
    print generatePassword(length = 20, using = "10")
    print generatePassword(length = 8)
    print generatePassword()
Output:
--------
    01011110010011000100

    z&v^9?dx

    +=z?=)vene

Initial Title
Generate Random Password

Initial Tags

                                

Initial Language
Python