# Bech32m.decode

Decodes a bech32m string (BIP-350) into a human-readable part and data bytes.

## Imports

:::code-group
```ts [Named]
import { Bech32m } from 'ox'
```

```ts [Entrypoint]
import * as Bech32m from 'ox/Bech32m'
```
:::

## Examples

```ts twoslash
import { Bech32m } from 'ox'

const { hrp, data } = Bech32m.decode(
  'tempo1qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqwa7xtm'
)
// @log: { hrp: 'tempo', data: Uint8Array(20) }
```

## Definition

```ts
function decode(
  str: string,
  options?: decode.Options,
): decode.ReturnType
```

**Source:** [src/core/Bech32m.ts](https://github.com/wevm/ox/blob/main/src/core/Bech32m.ts#L243)

## Parameters

### str

* **Type:** `string`

The bech32m-encoded string to decode.

### options

* **Type:** `decode.Options`
* **Optional**

#### options.limit

* **Type:** `number`
* **Optional**

Maximum length of the encoded string.

## Return Type

The decoded HRP and data bytes.

`decode.ReturnType`
