Skip to content

Commit 93b4dc4

Browse files
Refactor type hints and update version history
Updated type hints in functions to use Union for more flexible return types. Adjusted version history date and changed initial release description.
1 parent 3db6b3f commit 93b4dc4

1 file changed

Lines changed: 12 additions & 38 deletions

File tree

kha256/_version.py

Lines changed: 12 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
the KHA-256 cryptographic hash algorithm implementation.
88
"""
99

10-
from typing import Dict, List, Tuple, Optional
10+
from typing import Any, Dict, List, Optional, Tuple, Union
1111

1212
# Package version following Semantic Versioning (SemVer)
1313
# Format: MAJOR.MINOR.PATCH
@@ -111,7 +111,7 @@
111111

112112
def get_version_info() -> Dict[str, str]:
113113
"""Return a dictionary with all version information.
114-
114+
115115
Returns:
116116
Dict[str, str]: Dictionary containing version metadata.
117117
"""
@@ -127,9 +127,9 @@ def get_version_info() -> Dict[str, str]:
127127
}
128128

129129

130-
def get_dependency_info() -> Dict[str, List[str]]:
130+
def get_dependency_info() -> Dict[str, Union[List[str], Dict[str, List[str]]]]:
131131
"""Return dependency information.
132-
132+
133133
Returns:
134134
Dict[str, List[str]]: Dictionary containing dependency information.
135135
"""
@@ -141,24 +141,24 @@ def get_dependency_info() -> Dict[str, List[str]]:
141141

142142
def is_python_version_supported(major: int, minor: int) -> bool:
143143
"""Check if a given Python version is supported.
144-
144+
145145
Args:
146146
major: Python major version (e.g., 3)
147147
minor: Python minor version (e.g., 11)
148-
148+
149149
Returns:
150150
bool: True if the version is supported, False otherwise.
151151
"""
152152
min_supported = __min_python_version__
153153
max_supported = __max_python_version__
154-
154+
155155
version = (major, minor)
156156
return min_supported <= version <= max_supported
157157

158158

159159
def get_supported_python_versions() -> List[str]:
160160
"""Get a list of supported Python versions as strings.
161-
161+
162162
Returns:
163163
List[str]: List of supported Python versions.
164164
"""
@@ -168,39 +168,13 @@ def get_supported_python_versions() -> List[str]:
168168
return versions
169169

170170

171-
# Version history for changelog purposes
172-
__version_history__: List[Dict[str, str]] = [
173-
{
174-
"version": "0.2.2",
175-
"date": "2025-03-15",
176-
"changes": [
177-
"Security improvements",
178-
"Bug fixes in memory-hard functions",
179-
"Performance optimizations",
180-
],
181-
},
182-
{
183-
"version": "0.2.1",
184-
"date": "2025-02-01",
185-
"changes": [
186-
"Added fortified hash modes",
187-
"Improved hardware security ID generation",
188-
],
189-
},
190-
{
191-
"version": "0.2.0",
192-
"date": "2025-01-15",
193-
"changes": [
194-
"Major API improvements",
195-
"Added memory-hard functions",
196-
"Enhanced avalanche effect",
197-
],
198-
},
171+
# Version history for changelog purposes ← no indent
172+
__version_history__: List[Dict[str, Union[str, List[str]]]] = [ # ← no indent
199173
{
200174
"version": "0.1.0",
201-
"date": "2024-12-01",
175+
"date": "2024-12-29",
202176
"changes": [
203-
"Initial beta release",
177+
"Initial alpha release",
204178
"Core KHA-256 implementation",
205179
],
206180
},

0 commit comments

Comments
 (0)