# Bytes.fromArray

Converts an array of unsigned 8-bit integers into [`Bytes.Bytes`](/api/Bytes/types#bytes).

## Imports

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

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

## Examples

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

const data = Bytes.fromArray([255, 124, 5, 4])
// @log: Uint8Array([255, 124, 5, 4])
```

## Definition

```ts
function fromArray(
  value: readonly number[] | Uint8Array,
): Bytes
```

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

## Parameters

### value

* **Type:** `readonly number[] | Uint8Array`

Value to convert.

## Return Type

A [`Bytes.Bytes`](/api/Bytes/types#bytes) instance.

`Bytes`
