# compute_snapshot_id

> **Function** in `deepagents_code`

📖 [View in docs](https://reference.langchain.com/python/deepagents-code/hooks/loading/compute_snapshot_id)

Return the canonical SHA-256 snapshot id for `config`.

## Signature

```python
compute_snapshot_id(
    config: HooksConfig,
    *,
    groups: Mapping[HookEvent, Sequence[SourcedGroup]] | None = None,
) -> str
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `config` | `HooksConfig` | Yes | Validated Hooks v2 configuration. |
| `groups` | `Mapping[HookEvent, Sequence[SourcedGroup]] \| None` | No | Matching sourced groups, so provenance participates in the hash. (default: `None`) |

## Returns

`str`

Lowercase hex digest of the canonical JSON serialization.

---

[View source on GitHub](https://github.com/langchain-ai/deepagents/blob/4bfa52000ef65ac623d8ada0cb67f67cbdd663ea/libs/code/deepagents_code/hooks/loading.py#L272)