Skip to content

Instantly share code, notes, and snippets.

@touzoku
Created February 21, 2016 19:13
Show Gist options
  • Save touzoku/04414182183f5ccce508 to your computer and use it in GitHub Desktop.
Save touzoku/04414182183f5ccce508 to your computer and use it in GitHub Desktop.
Generates a password in Hiragana
# -*- coding: utf-8 -*-
from random import SystemRandom
import sys
chars = list(u"ぁあぃいぅうぇえぉおかがきぎくぐけげこごさざしじすずせぜそぞただちぢっつづてでとどなにぬねのはばぱひびぴふぶぷへべぺほぼぽまみむめもゃやゅゆょよらりるれろゎわゐゑをんぁあぃいぅうぇえぉおかがきぎくぐけげこごさざしじすずせぜそぞただちぢっつづてでとどなにぬねのはばぱひびぴふぶぷへべぺほぼぽまみむめもゃやゅゆょよらりるれろゎわゐゑをんぁあぃいぅうぇえぉおかがきぎくぐけげこごさざしじすずせぜそぞただちぢっつづてでとどなにぬねのはばぱひびぴふぶぷへべぺほぼぽまみむめもゃやゅゆょよらりるれろゎわゐゑをん")
length = int(sys.argv[1])
vocab = len(chars)
cryptogen = SystemRandom()
for i in range(length):
sys.stdout.write(chars[cryptogen.randrange(vocab)])
print
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment