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

# Encoding Tools

> Encode, decode, and hash data: Base64, URL, hex, HTML entities, and cryptographic hashing.

The Encoding Tools connector provides encoding/decoding operations (Base64, URL, hex, HTML, binary) and cryptographic hashing (MD5, SHA1, SHA256, SHA512, HMAC).

<Note>No connection required. This utility connector works out of the box.</Note>

## Tools

### Encoding / Decoding

<AccordionGroup>
  <Accordion title="base64-encode: Encode to Base64">
    <ParamField body="text" type="string" required>
      Text to encode.
    </ParamField>

    <ParamField body="urlSafe" type="boolean" default="false">
      Use URL-safe Base64 encoding.
    </ParamField>

    **Example request:**

    ```json theme={null}
    { "text": "Hello, World!", "urlSafe": false }
    ```

    **Example response:**

    ```json theme={null}
    { "result": "SGVsbG8sIFdvcmxkIQ==", "encoding": "base64" }
    ```
  </Accordion>

  <Accordion title="base64-decode: Decode Base64">
    <ParamField body="encoded" type="string" required>
      Base64 string to decode.
    </ParamField>

    <ParamField body="urlSafe" type="boolean" default="false">
      Input uses URL-safe encoding.
    </ParamField>

    **Example request:**

    ```json theme={null}
    { "encoded": "SGVsbG8sIFdvcmxkIQ==", "urlSafe": false }
    ```

    **Example response:**

    ```json theme={null}
    { "result": "Hello, World!", "encoding": "base64" }
    ```
  </Accordion>

  <Accordion title="url-encode: URL encode">
    <ParamField body="text" type="string" required>
      Text to encode.
    </ParamField>

    <ParamField body="encodeAll" type="boolean" default="false">
      Encode all characters (not just special characters).
    </ParamField>

    **Example request:**

    ```json theme={null}
    { "text": "name=John Doe&city=New York" }
    ```

    **Example response:**

    ```json theme={null}
    { "result": "name%3DJohn%20Doe%26city%3DNew%20York", "encoding": "url" }
    ```
  </Accordion>

  <Accordion title="url-decode: URL decode">
    <ParamField body="encoded" type="string" required>
      URL-encoded string to decode.
    </ParamField>

    **Example request:**

    ```json theme={null}
    { "encoded": "name%3DJohn%20Doe%26city%3DNew%20York" }
    ```

    **Example response:**

    ```json theme={null}
    { "result": "name=John Doe&city=New York", "encoding": "url" }
    ```
  </Accordion>

  <Accordion title="hex-encode: Encode to hex">
    <ParamField body="text" type="string" required>
      Text to encode.
    </ParamField>

    <ParamField body="uppercase" type="boolean" default="false">
      Use uppercase hex characters.
    </ParamField>

    **Example request:**

    ```json theme={null}
    { "text": "Hello", "uppercase": true }
    ```

    **Example response:**

    ```json theme={null}
    { "result": "48656C6C6F", "encoding": "hex-upper" }
    ```
  </Accordion>

  <Accordion title="hex-decode: Decode from hex">
    <ParamField body="hex" type="string" required>
      Hex string to decode.
    </ParamField>

    **Example request:**

    ```json theme={null}
    { "hex": "48656C6C6F" }
    ```

    **Example response:**

    ```json theme={null}
    { "result": "Hello", "encoding": "hex" }
    ```
  </Accordion>

  <Accordion title="html-encode: Encode HTML entities">
    Convert special characters to HTML entities.

    <ParamField body="text" type="string" required>
      Text to encode.
    </ParamField>

    **Example request:**

    ```json theme={null}
    { "text": "<div class=\"alert\">Price: $5 & up</div>" }
    ```

    **Example response:**

    ```json theme={null}
    { "result": "&lt;div class=&quot;alert&quot;&gt;Price: $5 &amp; up&lt;/div&gt;", "encoding": "html" }
    ```
  </Accordion>

  <Accordion title="html-decode: Decode HTML entities">
    Convert HTML entities back to characters.

    <ParamField body="text" type="string" required>
      Text with HTML entities to decode.
    </ParamField>

    **Example request:**

    ```json theme={null}
    { "text": "&lt;p&gt;Tom &amp; Jerry&lt;/p&gt;" }
    ```

    **Example response:**

    ```json theme={null}
    { "result": "<p>Tom & Jerry</p>", "encoding": "html" }
    ```
  </Accordion>

  <Accordion title="to-binary: Convert to binary">
    <ParamField body="text" type="string" required>
      Text to convert.
    </ParamField>

    <ParamField body="separator" type="string" default=" ">
      Separator between bytes.
    </ParamField>

    **Example request:**

    ```json theme={null}
    { "text": "Hi", "separator": " " }
    ```

    **Example response:**

    ```json theme={null}
    { "result": "01001000 01101001", "encoding": "binary" }
    ```
  </Accordion>

  <Accordion title="from-binary: Convert from binary">
    <ParamField body="binary" type="string" required>
      Binary string to convert.
    </ParamField>

    <ParamField body="separator" type="string" default=" ">
      Separator between bytes.
    </ParamField>

    **Example request:**

    ```json theme={null}
    { "binary": "01001000 01101001", "separator": " " }
    ```

    **Example response:**

    ```json theme={null}
    { "result": "Hi", "encoding": "binary" }
    ```
  </Accordion>
</AccordionGroup>

### Hashing

<AccordionGroup>
  <Accordion title="hash-md5: MD5 hash">
    <ParamField body="text" type="string" required>
      Text to hash.
    </ParamField>

    <ParamField body="encoding" type="string" default="hex">
      Output encoding: `hex` or `base64`.
    </ParamField>

    **Example request:**

    ```json theme={null}
    { "text": "user@example.com", "encoding": "hex" }
    ```

    **Example response:**

    ```json theme={null}
    { "hash": "b58996c504c5638798eb6b511e6f49af", "algorithm": "md5", "encoding": "hex" }
    ```
  </Accordion>

  <Accordion title="hash-sha1: SHA1 hash">
    <ParamField body="text" type="string" required>
      Text to hash.
    </ParamField>

    <ParamField body="encoding" type="string" default="hex">
      Output encoding: `hex` or `base64`.
    </ParamField>

    **Example request:**

    ```json theme={null}
    { "text": "Hello, World!" }
    ```

    **Example response:**

    ```json theme={null}
    { "hash": "943a702d06f34599aee1f8da8ef9f7296031d699", "algorithm": "sha1", "encoding": "hex" }
    ```
  </Accordion>

  <Accordion title="hash-sha256: SHA256 hash">
    <ParamField body="text" type="string" required>
      Text to hash.
    </ParamField>

    <ParamField body="encoding" type="string" default="hex">
      Output encoding: `hex` or `base64`.
    </ParamField>

    **Example request:**

    ```json theme={null}
    { "text": "sensitive-payload", "encoding": "hex" }
    ```

    **Example response:**

    ```json theme={null}
    { "hash": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2", "algorithm": "sha256", "encoding": "hex" }
    ```
  </Accordion>

  <Accordion title="hash-sha512: SHA512 hash">
    <ParamField body="text" type="string" required>
      Text to hash.
    </ParamField>

    <ParamField body="encoding" type="string" default="hex">
      Output encoding: `hex` or `base64`.
    </ParamField>

    **Example request:**

    ```json theme={null}
    { "text": "document-content", "encoding": "base64" }
    ```

    **Example response:**

    ```json theme={null}
    { "hash": "kG7s1j3dF8xQ2mN5pR7tY9wB4vK6hL0...", "algorithm": "sha512", "encoding": "base64" }
    ```
  </Accordion>

  <Accordion title="hmac: HMAC signature">
    <ParamField body="text" type="string" required>
      Text to sign.
    </ParamField>

    <ParamField body="secret" type="string" required>
      Secret key.
    </ParamField>

    <ParamField body="algorithm" type="string" default="sha256">
      Hash algorithm: `sha1`, `sha256`, `sha512`, or `md5`.
    </ParamField>

    <ParamField body="encoding" type="string" default="hex">
      Output encoding: `hex` or `base64`.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "text": "{\"event\":\"order.created\",\"id\":123}",
      "secret": "whsec_my_webhook_secret",
      "algorithm": "sha256",
      "encoding": "hex"
    }
    ```

    **Example response:**

    ```json theme={null}
    { "hash": "e4d7f1b3a2c5e8d6f9a0b1c2d3e4f5a6b7c8d9e0f1a2b3c4d5e6f7a8b9c0d1", "algorithm": "sha256", "encoding": "hex" }
    ```
  </Accordion>
</AccordionGroup>
