Skip to content

Bytes.toNumber

Decodes a Bytes.Bytes into a number.

Imports

Named
import { Bytes } from 'ox'

Examples

import { Bytes } from 'ox'
 
Bytes.toNumber(Bytes.from([1, 164]))
420

Definition

function toNumber(
  bytes: Bytes,
  options?: toNumber.Options,
): number

Source: src/Bytes.ts

Parameters

bytes

  • Type: Bytes

options

  • Type: toNumber.Options
  • Optional

options.signed

  • Type: boolean
  • Optional

Whether or not the number of a signed representation.

options.size

  • Type: number
  • Optional

Size of the bytes.

Return Type

number