11 lines
349 B
Python
11 lines
349 B
Python
import hashlib
|
|
from typing import Dict
|
|
|
|
|
|
def environment_hash(dependencies: Dict[str, str]) -> str:
|
|
# Deterministic fingerprint of an environment manifest (e.g., pip/conda deps)
|
|
items = sorted(dependencies.items())
|
|
payload = {"deps": items}
|
|
serialized = str(payload).encode("utf-8")
|
|
return hashlib.sha256(serialized).hexdigest()
|