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

# 編碼/解碼格式化器

> ArcScript 中用於編碼、解碼、雜湊和逸出字元串值的格式化器。

## base64decode()

將屬性值轉換為 base64 解碼字串。

## base64encode()

將屬性值轉換為 Base64 編碼字串。

## csvescape()

從匹配值的列傳回 CSV 資料，並將每個元素作為單獨結果輸出。

### 範例

在以下範例中，[csv 函式](./function-formatters#csv-value) 和 `csvescape` 選項都會從範例 CSV 文件中輸出。

```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>
```

執行此程式碼會顯示 CSV 標題下第一行的以下輸出。

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

## jsonescape()

將屬性值轉換為 JSON 轉義的單行字串。

## md5hash(\[converttobase64])

計算屬性值的 MD5 雜湊值。

* **encodetobase64**：可選布林值，用於指定是否將結果轉換為 Base64 編碼字串。預設值為 `true`。
* **inputencoding**：可選字串，用於指定輸入編碼。允許的值為 `utf-8`、`hex` 或 `base64`。預設值為 `utf-8`。

## sha1hash(\[converttobase64])

計算屬性值的 SHA-1 雜湊值。

* **encodetobase64**：可選布林值，用於指定是否將結果轉換為 Base64 編碼字串。預設值為 `true`。
* **inputencoding**：可選字串，用於指定輸入編碼。允許的值為 `utf-8`、`hex` 或 `base64`。預設值為 `utf-8`。

## sha2hash(\[converttobase64])

計算屬性值的 SHA-2 雜湊值。

* **encodetobase64**：可選布林值，用於指定是否將結果轉換為 Base64 編碼字串。預設值為 `true`。
* **inputencoding**：可選字串，用於指定輸入編碼。允許的值為 `utf-8`、`hex` 或 `base64`。預設值為 `utf-8`。

## sqlescape()

將屬性值轉換為 SQL 轉義的單行字串。

* **dbtype**：要編碼的資料庫型別。允許的值為 `SQL` 或 `SQLite`。預設值為 `SQL`。

## urldecode()

將屬性值轉換為 URL 解碼字串。

## urlencode()

將屬性值轉換為 URL 編碼字串。

## xmldecode()

將屬性值轉換為 XML 解碼字串。

## xmlencode()

將屬性值轉換為 XML 編碼字串。
