Function bytesToNumber

  • Convert a Uint8Array to a number.

    To convert a Uint8Array to a bigint instead, use bytesToBigInt.

    Returns

    The number.

    Throws

    If the resulting number is not a safe integer.

    Parameters

    • bytes: Uint8Array

      The bytes to convert to a number.

    Returns number