code: def sha256_digest(data: Union[str, bytes]) -> bytes:
      if isinstance(data, str):
          data = data.encode("utf8")
      return hashlib.sha256(data).digest()
  
imports: import hashlib
  from typing import Any, Sequence, Union
  import base58
  import multihash
  from cryptography.hazmat.primitives import serialization
  from multiaddr import Multiaddr, protocols
  from hivemind.proto import crypto_pb2, p2pd_pb2
label_desc: Use image node_id 1 for calling a global function with example usage: sha256_digest(data) and returns: hashlib