Hello Freedom
This commit is contained in:
31
infidel-code/py_wrappers/URG_PLAINGEN.py
Normal file
31
infidel-code/py_wrappers/URG_PLAINGEN.py
Normal file
@@ -0,0 +1,31 @@
|
||||
import random
|
||||
import string
|
||||
|
||||
|
||||
plain_length = []
|
||||
|
||||
def randstring(n):
|
||||
letters = string.digits
|
||||
return ''.join(random.choice(letters) for i in range(n))
|
||||
def rand_int(n):
|
||||
range_start = 10**(n-1)
|
||||
range_end = (10**n)-1
|
||||
return random.randint(range_start, range_end)
|
||||
i = 1
|
||||
while i <=16 :
|
||||
plain_length.append(i*1)
|
||||
i = i + 1
|
||||
base_name = "plain"
|
||||
|
||||
def file_handler(f_name, num, plain):
|
||||
plain = str(plain)
|
||||
num = str(num).zfill(2)
|
||||
f = open("./plain/"+f_name+"_"+num+".txt", "w")
|
||||
f.write(plain)
|
||||
|
||||
for i in plain_length:
|
||||
|
||||
plain = rand_int(i)
|
||||
file_handler(base_name, i, plain)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user