Skip to content

Rlp.fromBytes

Encodes a Bytes.Bytes value into a Recursive-Length Prefix (RLP) value.

Imports

Named
import { Rlp } from 'ox'

Examples

import { Bytes, Rlp } from 'ox'
 
Rlp.fromBytes(Bytes.from([139, 104, 101, 108, 108, 111,  32, 119, 111, 114, 108, 100]))
Uint8Array([104, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100])

Definition

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

Source: src/Rlp.ts

Parameters

bytes

  • Type: RecursiveArray<Bytes.Bytes>

The Bytes.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>