> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mirage.strukto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Checksums

> Use stored hashes to get file checksums without downloading them.

Mirage can answer checksum commands using a hash your storage service already
keeps, or by hashing the file on a remote server.

## Example: get a file's hash

With Google Drive mounted at `/drive/`:

```bash theme={null}
md5sum /drive/report.csv
```

Mirage uses the file's stored MD5 when available. Otherwise, it reads the file
and computes the hash. Verification commands such as `md5sum -c checksums.md5`
read the files to check their actual contents.

## Connect your own backend

Override `checksum(path, algorithm)` on your VFS. Return the file's hash as
lowercase hexadecimal text, matching exactly the bytes a normal read returns.

| Method | Commands | Used when |
| - | - | - |
| `checksum` with `md5` | `md5sum`, `md5` | Getting a file's MD5 hash. |
| `checksum` with `sha1` | `sha1sum` | Getting a file's SHA-1 hash. |
| `checksum` with `sha256` | `sha256sum` | Getting a file's SHA-256 hash. |
| `checksum` with `sha384` | `sha384sum` | Getting a file's SHA-384 hash. |
| `checksum` with `sha512` | `sha512sum` | Getting a file's SHA-512 hash. |

The method name is the same in Python and TypeScript. Verification with `-c`
reads the files instead. Return `None` in Python or `null` in TypeScript when
the hash is unavailable, and Mirage computes it from the file.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.