Files
python-teos/common/tools.py
Sergi Delgado Segura b363cc2d94 Adds missing tool tests
2019-12-16 12:57:28 +01:00

15 lines
356 B
Python

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`: Whether or not the value matches the format.
"""
return isinstance(value, str) and re.match(r"^[0-9A-Fa-f]{64}$", value) is not None