mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-09-19 14:48:38 +03:00
3b084a165b
* 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
16 lines
384 B
Python
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())
|