code: def hash_primitive(
      primitive: PrimitiveBase,
  ) -> Tuple[str, Dict[str, Any]]:
      hash_msg = hashlib.sha256()
      primitive_name = primitive.name
      assert isinstance(primitive_name, str)
      primitive_dict = serialize_primitive(primitive)
      primitive_json = json.dumps(primitive_dict).encode("utf-8")
      hash_msg.update(primitive_json)
      key = hash_msg.hexdigest()
      return (key, primitive_dict)
  
file_path: featuretools/featuretools/feature_discovery/utils.py
imports: import hashlib
  import json
  from functools import lru_cache
  from typing import Any, Dict, Tuple
  from woodwork.column_schema import ColumnSchema
  from featuretools.feature_discovery.type_defs import ANY
  from featuretools.primitives.base.primitive_base import PrimitiveBase
  from featuretools.primitives.utils import get_all_logical_type_names, get_all_primitives, serialize_primitive
label_desc: Use image node_id 2 for calling a global function with example usage: hash_primitive(primitive) and returns: key,  primitive_dict