> ## Documentation Index
> Fetch the complete documentation index at: https://kremis.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# hash

> Compute BLAKE3 cryptographic hash of the graph.

```bash theme={null}
kremis hash [OPTIONS]
```

Computes a BLAKE3 cryptographic hash of the graph's canonical export.
The hash is deterministic: the same graph state always produces the same 64-character hex digest.

## Options

| Option        | Short | Description                        | Default     |
| ------------- | ----- | ---------------------------------- | ----------- |
| `--json-mode` | -     | Output as JSON                     | false       |
| `--database`  | `-D`  | Path to database file              | `kremis.db` |
| `--backend`   | `-B`  | Storage backend (`file` or `redb`) | `redb`      |

## Output

**Default (human-readable):**

```
BLAKE3: a3b4c5d6e7f8a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a1b2c3d4e5f6a7b8
Checksum (XOR): 14823901234567890
```

**JSON mode (`--json-mode`):**

```json theme={null}
{
  "hash": "a3b4c5d6e7f8a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a1b2c3d4e5f6a7b8",
  "algorithm": "blake3",
  "checksum": 14823901234567890
}
```

## Examples

```bash theme={null}
# Hash default database (redb, empty)
kremis hash

# Hash persistent graph
kremis hash -D kremis.db -B file

# JSON output for scripting
kremis --json-mode hash -D kremis.db -B file

# Compare hashes before and after ingestion
H1=$(kremis --json-mode hash -D kremis.db -B file | jq -r '.hash')
kremis ingest --file signals.json -D kremis.db -B file
H2=$(kremis --json-mode hash -D kremis.db -B file | jq -r '.hash')
[ "$H1" != "$H2" ] && echo "Graph changed"
```
