# Rlp.fromBytes

Encodes a [`Bytes.Bytes`](/api/Bytes/types#bytes) value into a Recursive-Length Prefix (RLP) value.

## Imports

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

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

## Examples

```ts twoslash
import { Bytes, Rlp } from 'ox'

Rlp.fromBytes(
  Bytes.from([
    139, 104, 101, 108, 108, 111, 32, 119, 111, 114, 108,
    100
  ])
)
// @log: Uint8Array([104, 101, 108, 108, 111,  32, 119, 111, 114, 108, 100])
```

## Definition

```ts
function fromBytes<as>(
  bytes: RecursiveArray<Bytes.Bytes>,
  options?: fromBytes.Options<as>,
): fromBytes.ReturnType<as>
```

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

## Parameters

### bytes

* **Type:** `RecursiveArray<Bytes.Bytes>`

The [`Bytes.Bytes`](/api/Bytes/types#bytes) value to encode.

### options

* **Type:** `fromBytes.Options<as>`
* **Optional**

Options.

#### options.as

* **Type:** `"Bytes" | "Hex" | as`

The type to convert the RLP value to.

## Return Type

The RLP value.

`fromBytes.ReturnType<as>`
