Compute and compare a file checksum
file_checksumVerify a local file's integrity by computing its SHA-256 or SHA-512 digest and comparing it with an expected value; supports files up to 32 MiB.
Instructions
Computes the SHA-256 or SHA-512 digest of a local file (regular file, up to 32 MiB) and optionally compares it with an expected value. A match proves only that the file equals whatever the expected value was taken from, so it is only as trustworthy as the source of that value.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Path of the file to hash (regular file, up to 32 MiB). | |
| expected | No | Optional expected digest (hex; "sha256:<hex>" and sha256sum-style "<hex> name" are accepted) to compare against. | |
| algorithm | Yes | Digest algorithm. |