chia-blockchain/chia/util/hash.py
Kyle Altendorf 3b084a165b
configure isort to add the future annotations import (#13327)
* configure isort to add the future annotations import

* apply the new isort setting

* remove type ignores for new mypy (#13539)

https://pypi.org/project/mypy/0.981/

* another
2022-09-30 03:40:22 -05:00

16 lines
384 B
Python

from __future__ import annotations
from hashlib import sha256
from chia.types.blockchain_format.sized_bytes import bytes32
def std_hash(b, skip_bytes_conversion: bool = False) -> bytes32:
"""
The standard hash used in many places.
"""
if skip_bytes_conversion:
return bytes32(sha256(b).digest())
else:
return bytes32(sha256(bytes(b)).digest())