HWVL 0.0.1__py3-none-any.whl → 1.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {hwvl-0.0.1.dist-info → hwvl-1.0.0.dist-info}/METADATA +11 -1
- hwvl-1.0.0.dist-info/RECORD +4 -0
- hwvl-1.0.0.dist-info/top_level.txt +1 -0
- HWVL/HWVL.py +0 -83
- HWVL/__init__.py +0 -1
- hwvl-0.0.1.dist-info/RECORD +0 -6
- hwvl-0.0.1.dist-info/top_level.txt +0 -1
- {hwvl-0.0.1.dist-info → hwvl-1.0.0.dist-info}/WHEEL +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: HWVL
|
3
|
-
Version: 0.0
|
3
|
+
Version: 1.0.0
|
4
4
|
Summary: The first Iranian hash
|
5
5
|
Home-page: https://github.com/HWVL/hash-HWVL
|
6
6
|
Author: mohammad rakhshkhorshid
|
@@ -18,6 +18,7 @@ Dynamic: home-page
|
|
18
18
|
Dynamic: requires-python
|
19
19
|
Dynamic: summary
|
20
20
|
|
21
|
+
The first Iranian hash
|
21
22
|
# HWVL Hash
|
22
23
|
HWVL Hash stands for "Hash with Variable Length."
|
23
24
|
|
@@ -38,3 +39,12 @@ Our hash introduces an innovation in the world of security, as it takes two inpu
|
|
38
39
|
- The length of the output
|
39
40
|
|
40
41
|
Increasing the output length slows down the process but enhances security; the larger this number, the lower the probability of the hash being compromised.
|
42
|
+
|
43
|
+
# How to run:
|
44
|
+
First import the library into the program with the following code:
|
45
|
+
|
46
|
+
from HWVL.HWVL import HWVL
|
47
|
+
|
48
|
+
Now get the hash with the HWVL function
|
49
|
+
|
50
|
+
print(HWVL("hello",10))
|
@@ -0,0 +1,4 @@
|
|
1
|
+
hwvl-1.0.0.dist-info/METADATA,sha256=zTkjoKjAijFY1E7Cn3-Y8PKJoVHvQy4ERSDbDQCARUs,1760
|
2
|
+
hwvl-1.0.0.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
|
3
|
+
hwvl-1.0.0.dist-info/top_level.txt,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
4
|
+
hwvl-1.0.0.dist-info/RECORD,,
|
@@ -0,0 +1 @@
|
|
1
|
+
|
HWVL/HWVL.py
DELETED
@@ -1,83 +0,0 @@
|
|
1
|
-
from os import system, name
|
2
|
-
|
3
|
-
def clear_console():
|
4
|
-
|
5
|
-
if name == 'nt':
|
6
|
-
system('cls')
|
7
|
-
else:
|
8
|
-
system('clear')
|
9
|
-
|
10
|
-
def string_to_int(char):
|
11
|
-
return ord(char)
|
12
|
-
|
13
|
-
def int_to_string(Int):
|
14
|
-
printable_start = 33
|
15
|
-
printable_end = 126
|
16
|
-
range_size = printable_end - printable_start + 1
|
17
|
-
return chr(printable_start + (Int % range_size))
|
18
|
-
|
19
|
-
def shift_right(lst, shift):
|
20
|
-
shift = shift % len(lst)
|
21
|
-
return lst[-shift:] + lst[:-shift]
|
22
|
-
|
23
|
-
def calculate_column_wise_average(lst):
|
24
|
-
num_columns = len(lst[0])
|
25
|
-
return [round(sum(row[j] for row in lst) / len(lst)) for j in range(num_columns)]
|
26
|
-
|
27
|
-
def average_with_right(lst):
|
28
|
-
|
29
|
-
if len(lst) < 2:
|
30
|
-
return lst
|
31
|
-
|
32
|
-
new_lst = []
|
33
|
-
|
34
|
-
for i in range(len(lst) - 1):
|
35
|
-
|
36
|
-
avg = (lst[i] + lst[i + 1]) / 2
|
37
|
-
new_lst.append(avg)
|
38
|
-
|
39
|
-
avg_last_first = (lst[-1] + lst[0]) / 2
|
40
|
-
new_lst.append(avg_last_first)
|
41
|
-
return new_lst
|
42
|
-
|
43
|
-
def HWVL(text="",l=32):
|
44
|
-
if text=="":
|
45
|
-
return ""
|
46
|
-
|
47
|
-
while not len(text)%l==0:
|
48
|
-
text+="@"
|
49
|
-
b=[]
|
50
|
-
|
51
|
-
for a in range(len(text)//l):
|
52
|
-
li=[]
|
53
|
-
for i in list(text[a*l:(a+1)*l]):
|
54
|
-
li.append(string_to_int(i))
|
55
|
-
li=average_with_right(li)
|
56
|
-
|
57
|
-
for i in range(l):
|
58
|
-
li=shift_right(li,int(li[0]))
|
59
|
-
li.sort()
|
60
|
-
for i in range(len(li)-2):
|
61
|
-
li[i]=li[i]*li[i+1]/li[i+2]
|
62
|
-
li.reverse()
|
63
|
-
b.append(li)
|
64
|
-
|
65
|
-
output_list=calculate_column_wise_average(b)
|
66
|
-
output_text=""
|
67
|
-
|
68
|
-
for i in output_list:
|
69
|
-
output_text+=int_to_string(i)
|
70
|
-
|
71
|
-
|
72
|
-
return output_text
|
73
|
-
|
74
|
-
if __name__ == "__main__":
|
75
|
-
while True:
|
76
|
-
text=input(">>>")
|
77
|
-
if text=="exit":
|
78
|
-
break
|
79
|
-
elif text=="cls":
|
80
|
-
clear_console()
|
81
|
-
elif text!="":
|
82
|
-
Hash=HWVL(text)
|
83
|
-
print(Hash)
|
HWVL/__init__.py
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
import HWVL.HWVL as HWVL
|
hwvl-0.0.1.dist-info/RECORD
DELETED
@@ -1,6 +0,0 @@
|
|
1
|
-
HWVL/HWVL.py,sha256=u1D-eIbplvRHx8p4x1qpGAlxpx0YtUjQTKvh8evU204,1937
|
2
|
-
HWVL/__init__.py,sha256=iyglV9h5Y2_b-socdKRUoV1T0e0svI75s3RDpPy8Tbo,24
|
3
|
-
hwvl-0.0.1.dist-info/METADATA,sha256=2At7DDPeyDRzt-wmAtYGTHDmEZBbgsgT8PeKFTzcIdQ,1550
|
4
|
-
hwvl-0.0.1.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
|
5
|
-
hwvl-0.0.1.dist-info/top_level.txt,sha256=gxNCWGIvbEqRWmPNZVPe0OOsP0VomtjCputhPd6dEZQ,5
|
6
|
-
hwvl-0.0.1.dist-info/RECORD,,
|
@@ -1 +0,0 @@
|
|
1
|
-
HWVL
|
File without changes
|