Skip to content

Instantly share code, notes, and snippets.

@discreet
Created September 29, 2014 20:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save discreet/8e3c195dba5635fda5bc to your computer and use it in GitHub Desktop.
Save discreet/8e3c195dba5635fda5bc to your computer and use it in GitHub Desktop.
password generator with hash
import os, random, string, hashlib
length = 23
chars = string.ascii_letters + string.digits + '!@#$%^&*()'
rnd = random.SystemRandom()
rpass = ''.join(rnd.choice(chars) for i in range(length))
m = hashlib.sha1()
m.update(rpass)
print m.hexdigest()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment