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

# Hash

# \$hash

The `$hash` operator computes a hash of the input using the specified algorithm.

## Input

* An array containing exactly two values: the input value to hash and the hash algorithm to use ("md5", "sha1", or "sha256")

## Output

* A string representation of the computed hash

## Examples

### Compute MD5 Hash

```json theme={null}
{
  "$hash": [
    "hello world",
    "md5"
  ]
}
```

Result: `"5d41402abc4b2a76b9719d911017c592"`

### Compute SHA256 Hash

```json theme={null}
{
  "$hash": [
    "hello world",
    "sha256"
  ]
}
```

Result: `"a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e"`

### From Fields

```json theme={null}
{
  "$hash": [
    {
      "$input": "data"
    },
    {
      "$input": "algorithm"
    }
  ]
}
```

Result: The hash of the data field using the algorithm specified in the algorithm field
