forked from stevenang/randomness_testsuite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTools.py
More file actions
27 lines (21 loc) · 620 Bytes
/
Copy pathTools.py
File metadata and controls
27 lines (21 loc) · 620 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
class Tools:
@staticmethod
def string_to_binary(input:str):
binary = []
for char in input:
temp = bin(ord(char))[2:]
while(len(temp) < 8):
temp = '0' + temp
binary.append(temp)
return ''.join(binary)
@staticmethod
def string_to_binary_no_concat(input: str):
binary = []
for char in input:
binary.append(bin(ord(char))[2:])
return ''.join(binary)
@staticmethod
def url_to_binary(input:str):
binary = []
url = input.split('/')[-1].split('.')[0]
return url