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

# Encoding/Decoding Formatters

> Formatters for encoding, decoding, hashing, and escaping string values in ArcScript.

## base64decode()

Converts the attribute value to a base 64 decoded string.

## base64encode()

Converts the attribute value to a Base64-encoded string.

## csvescape()

Returns CSV data from the column that matches a value with each element output as individual results.

### Example

In the following example, both the [csv function](./function-formatters#csv-value) and the `csvescape` options are output from the sample CSV document.

```xml theme={null}
<arc:call op="csvListRecords">
Standard output: [csv('column1')], [csv('column2')], [csv('column3')]
Output with csvescape(): [csv('column1') | csvescape()], [csv('column2') | csvescape()], [csv('column3') | csvescape()]
</arc:call>
```

Running this code displays the following output for the first row under the CSV headers.

```
Standard output: entry1, entry2, entry3
Output with csvescape(): "entry1", "entry2", "entry3"
```

## jsonescape()

Converts the attribute value to a JSON-escaped, single-line string.

## md5hash(\[converttobase64])

Computes the MD5 hash of the attribute value.

* **encodetobase64**: The optional boolean value that specifies whether to convert the result into a Base64-encoded string. The default is `true`.
* **inputencoding**: The optional string that specifies the input encoding. The allowed values are `utf-8`, `hex`, or `base64`. The default is `utf-8`.

## sha1hash(\[converttobase64])

Computes the SHA-1 hash of the attribute value.

* **encodetobase64**: The optional boolean value that specifies whether to convert the result into a Base64-encoded string. The default is `true`.
* **inputencoding**: The optional string that specifies the input encoding. The allowed values are `utf-8`, `hex`, or `base64`. The default is `utf-8`.

## sha2hash(\[converttobase64])

Computes the SHA-2 hash of the attribute value.

* **encodetobase64**: The optional boolean value that specifies whether to convert the result into a Base64-encoded string. The default is `true`.
* **inputencoding**: The optional string that specifies the input encoding. The allowed values are `utf-8`, `hex`, or `base64`. The default is `utf-8`.

## sqlescape()

Converts the attribute value to an SQL-escaped, single-line string.

* **dbtype**: The database type to encode. The allowed values are `SQL` or `SQLite`. The default is `SQL`.

## urldecode()

Converts the attribute value to a URL-decoded string.

## urlencode()

Converts the attribute value to a URL-encoded string.

## xmldecode()

Converts the attribute value to a XML-decoded string.

## xmlencode()

Converts the attribute value to a XML-encoded string.
