Docstrings for common package

This commit is contained in:
Sergi Delgado Segura
2019-12-13 17:55:50 +01:00
parent e2ca226b11
commit 83c73d5df4
2 changed files with 157 additions and 20 deletions

View File

@@ -2,4 +2,13 @@ import re
def check_sha256_hex_format(value):
"""
Checks if a given value is a 32-byte hex encoded string.
Args:
value(:mod:`str`): the value to be checked.
Returns:
:mod:`bool`: Wether or not the value matches the format.
"""
return isinstance(value, str) and re.search(r"^[0-9A-Fa-f]{64}$", value) is not None