Mentions légales du service

Skip to content
Snippets Groups Projects
Commit c527d62c authored by BOULLE Olivier's avatar BOULLE Olivier
Browse files

typings

parent 27c516ea
No related branches found
No related tags found
No related merge requests found
......@@ -6,8 +6,7 @@ use SHA256 hashing on sequences
"""
def base10_to_lower_base_convert(i, base):
def base10_to_lower_base_convert(i: int, base: int) -> str:
"""
return the number i written in a lower base
"""
......@@ -18,7 +17,7 @@ def base10_to_lower_base_convert(i, base):
return "".join(result)
def base16_to_base4(base16_hash):
def base16_to_base4(base16_hash: str) -> str:
"""
convert a string representing a number in base 16 to a string representing a number in base 4
"""
......@@ -27,7 +26,7 @@ def base16_to_base4(base16_hash):
return base4_hash
def hash_string_to_formated_base4(input_string, hash_size):
def hash_string_to_formated_base4(input_string: str, hash_size: int) -> str:
"""
apply SHA256 hashing to a string to get a hash in base4 and of a specified size
a basic hash is 64 long (base 16); so 128 long when reduced to base 4
......@@ -50,7 +49,7 @@ def hash_string_to_formated_base4(input_string, hash_size):
return base4_total_hash[:hash_size] # remove excess size
def sha256_hash(input_string):
def sha256_hash(input_string: str) -> str:
"""
SHA256 hashing, result is in base 16
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment