-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpoc.py
More file actions
executable file
·48 lines (40 loc) · 1.27 KB
/
poc.py
File metadata and controls
executable file
·48 lines (40 loc) · 1.27 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/env python3
import re
with open('src/data/first-names-female.txt') as f:
female_names = f.read().splitlines()
with open('src/data/first-names-male.txt') as f:
male_names = f.read().splitlines()
with open('src/data/last-names.txt') as f:
last_names = f.read().splitlines()
intsex_names = female_names + male_names
slkin = input('SLK: ')
slk = slkin.strip()
if len(slk) < 14:
slk_gender = '9'
elif len(slk) == 14:
slk_gender = slk[-1:]
else:
slk_gender = slk[13]
slk_first = slk[3:5].replace('2', '.')
slk_last = slk[0:3].replace('2', '.')
slk_dob = slk[5:13]
if slk_gender == '1':
first_names = male_names
gender_type = 'Male'
elif slk_gender == '2':
first_names = female_names
gender_type = 'Female'
elif slk_gender == '3':
first_names = intsex_names
gender_type = 'Intersex'
else:
first_names = intsex_names
gender_type = 'Unknown'
first = [name for name in first_names if re.match('.' + slk_first, name) is not None]
last = [name for name in last_names if re.match('.' + slk_last[0:2] + '.' + slk_last[2], name) is not None]
print("First names:")
print(first)
print("Last names:")
print(last)
print(("Date of birth: {}/{}/{}".format(slk_dob[0:2], slk_dob[2:4], slk_dob[4:8])))
print(("Gender: {}".format(gender_type)))