# Compute a chart's digest

> Get the sha256 that proves the store installs exactly the files you wrote.

Your chart needs `source.sha256`, the digest of its folder, and you want the exact value the store will compute.

## Solution

Run `alta package` on the chart's folder. For the [example data chart](https://docs.altasystem.ai/charts/guides/quest-pack) saved as `my-chart/`:

```sh [Terminal]
alta package my-chart
```

```text [Output]
packaged 2 files into …/my-chart.alta.tar (4608 bytes)
  archive sha256: cdb3bb4f53667b894e8f3003ad27a6831b62398a1c118f1113bf8697f2feb52e
  tree digest (the source.sha256 of a chart): e8e0077522bddce6c1a76fb68fecf15c8a7654fd669c2627855ff7f0a73771a3
  source block (the commit and the address come from `alta publish`):
    {
      "git": "https://<your repository>",
      "commit": "<full commit of the push>",
      "sha256": "e8e0077522bddce6c1a76fb68fecf15c8a7654fd669c2627855ff7f0a73771a3"
    }
```

Copy the **tree digest** into `source.sha256`.

## How it works

`alta package` checks the folder first and stops on a problem. Then it computes two values. The **tree digest** covers the path and the bytes of every file, in a fixed order, so it changes when any file changes and never depends on dates, permissions or the machine: it is the value the store recomputes after cloning your repository, and a chart whose files differ is refused. The **archive sha256** is the digest of the `.alta.tar` file written next to the folder, for when you share the archive itself.

## Variants

- **For a script.** `alta package my-chart --json` prints the same values as JSON.
- **Elsewhere.** `--out dist/my-chart.alta.tar` writes the archive where you want it.
- **The whole source block.** The digest of the folder as committed, with the address and the commit, comes from `alta publish`: see [Pin a commit and fill source](https://docs.altasystem.ai/recipes/pin-commit).

**Next:**

- [Pin a commit and fill source](https://docs.altasystem.ai/recipes/pin-commit)
- [Publish a chart](https://docs.altasystem.ai/marketplace/publish)
- [alta package](https://docs.altasystem.ai/reference/cli/package)
