forked from anirudhjoshi/lastpass2keepass
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_generator.py
35 lines (26 loc) · 1.35 KB
/
test_generator.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/python
# url,username,password,1extra,name,grouping(\ delimited),last_touch,launch_count,fav
import random, datetime, unicodedata, string
now = datetime.datetime.now()
formattedNow = now.strftime("%Y-%m-%dT%H:%M")
appendToFile = open("test_passwords.txt", "w" ).close()
appendToFile = open("test_passwords.txt", "a" )
unicode_glyphs = ''.join(
unichr(char)
for char in xrange(1114112) # 0x10ffff + 1
if unicodedata.category(unichr(char))[0] in ('LMNPSZ')
)
# Generator
for i in range(1, 250):
url = "www." + "".join( [random.choice(unicode_glyphs).encode('utf-8') for i in xrange(4)]) + ".com"
username = "username_" + "".join( [random.choice(unicode_glyphs).encode('utf-8') for i in xrange(4)] )
password = "password_" + "".join( [random.choice(unicode_glyphs).encode('utf-8') for i in xrange(15)] )
extra = "extra_" + "".join( [random.choice(unicode_glyphs).encode('utf-8') for i in xrange(4)] )
name = "WEBSITE_NAME_" + "".join( [random.choice(unicode_glyphs).encode('utf-8') for i in xrange(4)] )
grouping = "All\Main"
last_touch = formattedNow
launch_count = str(i)
fav = "".join( [random.choice(unicode_glyphs).encode('utf-8') for i in xrange(1)] )
entry = [url, username, password, extra, name, grouping, last_touch, launch_count, fav]
appendToFile.write(",".join(entry)+'\n')
appendToFile.close()