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

# md5

> Compute the MD5 hash of a string.

`md5(str)` returns the lowercase hexadecimal MD5 hash of `str`.

## Signature

```
md5(str string) string
```

## Example

Generate a cache key for a dependency installation step based on the contents of the lock file. If the lock file has not changed since the last run, the cache key stays the same:

```hcl theme={null}
computed "dep_cache_key" {
  description = "Cache key based on lock file contents"
  expression  = "deps-${md5(file("go.sum"))}"
}

task "restore-cache" {
  description = "Restore the module cache if available"
  commands    = ["cache restore ${computed.dep_cache_key} || true"]
}

task "install" {
  description = "Download Go module dependencies"
  depends_on  = [task.restore-cache]
  commands    = ["go mod download"]
}

task "save-cache" {
  description = "Save the module cache"
  depends_on  = [task.install]
  commands    = ["cache save ${computed.dep_cache_key}"]
}
```

## Notes

* MD5 is suitable for cache keys and checksums but not for security-sensitive hashing. Use [`sha256`](/functions/crypto/sha256) for integrity verification.
* The output is always a 32-character lowercase hexadecimal string.
