Skip to content

Instantly share code, notes, and snippets.

@mnzk
Created June 16, 2011 13:41
Show Gist options
  • Save mnzk/1029249 to your computer and use it in GitHub Desktop.
Save mnzk/1029249 to your computer and use it in GitHub Desktop.
functional(?) randomPasswordGenerator
#see https://gist.github.com/1023982 (donotuse.py)
randomPasswordGenerator = (
lambda repeat, choice, partial, digits, letters:
partial(lambda map_join, n:
map_join(choice, repeat(digits+letters, n)),
lambda f, lis: ''.join(map(f, lis))))(
__import__('itertools').repeat,
__import__('random').choice,
__import__('functools').partial,
__import__('string').digits,
__import__('string').letters)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment