-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathobd_generator.py
More file actions
39 lines (29 loc) · 737 Bytes
/
Copy pathobd_generator.py
File metadata and controls
39 lines (29 loc) · 737 Bytes
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
36
from random import randint
import random
import string
def _gen(size=6, chars=string.ascii_uppercase + string.digits):
return ''.join(random.choice(chars) for _ in range(size))
def _genATstring():
length = randint(1,6)
stringa = "AT" + _gen(length) + '\r'
return stringa
def _genNumber():
if randint(0,1) == 0:
return "0" + str(randint(0,999))
else:
return randint(0,99999)
def _getRandomData():
length = randint(1,20)
return _gen(length, string.printable)
def generator():
index = _gen(1,"12312")
# 40% of probability
if index == "1":
result = _genATstring()
# 40% of probability
elif index == "2":
result = _genNumber()
# 20% of probability
else:
result = _getRandomData()
return str(result)