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

# encodeBytes32

```ts theme={null}
function encodeBytes32(text): string
```

Encodes a string as a Bytes32 string. This is used to encode ABI data.

## Parameters

| Parameter | Type     | Description           |
| :-------- | :------- | :-------------------- |
| `text`    | `string` | The string to encode. |

## Returns

`string`

The Bytes32-encoded string.

## Throws

If the string is too long to fit in a Bytes32 format.

## Source

[encoding/bytes32.ts:20](https://github.com/dominant-strategies/quais.js/blob/c1c12d43f9d34c6baad2b0542bd6d0acd6fefcbf/src/encoding/bytes32.ts#L20)
