---
title: CONST_EQUALS
url: https://www.tines.com/docs/formulas/functions/const-equals/
kind: formula-function
---

*[tines.com](https://www.tines.com/llms.txt) › [Docs](https://www.tines.com/llms.txt) › [Formulas](https://www.tines.com/llm/docs/formulas.md) › [Functions](https://www.tines.com/llm/docs/formulas/functions.md)*

# CONST_EQUALS

*[View on tines.com](https://www.tines.com/docs/formulas/functions/const-equals/)*

Performs a timing-safe comparison of two strings using OpenSSL.fixed_length_secure_compare. Returns true if the strings are identical, false otherwise. If objects that are not strings are passed in, they are stringified before comparison This method helps prevent timing attacks when comparing sensitive values like tokens or signatures. Please note that this formula is not resistant to timing attacks to determine secret length.

**Categories:** Text

## Syntax

```
CONST_EQUALS(string1, string2)
```

## Examples

### Example 1

Input:

```json
{
  "my_action": {
    "input": "secret_token",
    "expected": "secret_token"
  }
}
```

Formula:

```
CONST_EQUALS(my_action.input, my_action.expected)
```

Output:

```json
true
```

### Example 2

Input:

```json
{
  "my_action": {
    "input": "wrong_token",
    "expected": "secret_token"
  }
}
```

Formula:

```
CONST_EQUALS(my_action.input, my_action.expected)
```

Output:

```json
false
```

## Sample actions

```json
{
  "standardLibVersion": "79",
  "actionRuntimeVersion": "2",
  "agents": [
    {
      "disabled": false,
      "name": "My Action",
      "description": "",
      "options": {
        "mode": "message_only",
        "loop": false,
        "payload": {
          "input": "secret_token",
          "expected": "secret_token"
        }
      },
      "position": {
        "x": 3075,
        "y": 3225
      },
      "type": "eventTransformation",
      "timeSavedUnit": "minutes",
      "timeSavedValue": 0,
      "monitorAllEvents": false,
      "monitorFailures": false,
      "monitorNoEventsEmitted": null,
      "form": null
    },
    {
      "disabled": false,
      "name": "CONST_EQUALS",
      "description": "",
      "options": {
        "mode": "message_only",
        "loop": false,
        "payload": {
          "result": "=CONST_EQUALS(my_action.input, my_action.expected)"
        }
      },
      "position": {
        "x": 3075,
        "y": 3330
      },
      "type": "eventTransformation",
      "timeSavedUnit": "minutes",
      "timeSavedValue": 0,
      "monitorAllEvents": false,
      "monitorFailures": false,
      "monitorNoEventsEmitted": null,
      "form": null
    }
  ],
  "links": [
    {
      "sourceIdentifier": 0,
      "receiverIdentifier": 1
    }
  ],
  "diagramNotes": []
}
```
