Options
All
  • Public
  • Public/Protected
  • All
Menu

External module "binary/binary"

Index

Variables

writeInt16BE

writeInt16BE: writeUint16BE = writeUint16BE

writeInt16LE

writeInt16LE: writeUint16LE = writeUint16LE

writeInt32BE

writeInt32BE: writeUint32BE = writeUint32BE

writeInt32LE

writeInt32LE: writeUint32LE = writeUint32LE

writeInt64BE

writeInt64BE: writeUint64BE = writeUint64BE

writeInt64LE

writeInt64LE: writeUint64LE = writeUint64LE

Functions

readFloat32BE

  • readFloat32BE(array: Uint8Array, offset?: number): number
  • Reads 4 bytes from array starting at offset as big-endian 32-bit floating-point number and returns it.

    Parameters

    • array: Uint8Array
    • Default value offset: number = 0

    Returns number

readFloat32LE

  • readFloat32LE(array: Uint8Array, offset?: number): number
  • Reads 4 bytes from array starting at offset as little-endian 32-bit floating-point number and returns it.

    Parameters

    • array: Uint8Array
    • Default value offset: number = 0

    Returns number

readFloat64BE

  • readFloat64BE(array: Uint8Array, offset?: number): number
  • Reads 8 bytes from array starting at offset as big-endian 64-bit floating-point number ("double") and returns it.

    Parameters

    • array: Uint8Array
    • Default value offset: number = 0

    Returns number

readFloat64LE

  • readFloat64LE(array: Uint8Array, offset?: number): number
  • Reads 8 bytes from array starting at offset as little-endian 64-bit floating-point number ("double") and returns it.

    Parameters

    • array: Uint8Array
    • Default value offset: number = 0

    Returns number

readInt16BE

  • readInt16BE(array: Uint8Array, offset?: number): number
  • Reads 2 bytes from array starting at offset as big-endian signed 16-bit integer and returns it.

    Parameters

    • array: Uint8Array
    • Default value offset: number = 0

    Returns number

readInt16LE

  • readInt16LE(array: Uint8Array, offset?: number): number
  • Reads 2 bytes from array starting at offset as little-endian signed 16-bit integer and returns it.

    Parameters

    • array: Uint8Array
    • Default value offset: number = 0

    Returns number

readInt32BE

  • readInt32BE(array: Uint8Array, offset?: number): number
  • Reads 4 bytes from array starting at offset as big-endian signed 32-bit integer and returns it.

    Parameters

    • array: Uint8Array
    • Default value offset: number = 0

    Returns number

readInt32LE

  • readInt32LE(array: Uint8Array, offset?: number): number
  • Reads 4 bytes from array starting at offset as little-endian signed 32-bit integer and returns it.

    Parameters

    • array: Uint8Array
    • Default value offset: number = 0

    Returns number

readInt64BE

  • readInt64BE(array: Uint8Array, offset?: number): number
  • Reads 8 bytes from array starting at offset as big-endian signed 64-bit integer and returns it.

    Due to JavaScript limitation, supports values up to 2^53-1.

    XXX: not constant-time.

    Parameters

    • array: Uint8Array
    • Default value offset: number = 0

    Returns number

readInt64LE

  • readInt64LE(array: Uint8Array, offset?: number): number
  • Reads 8 bytes from array starting at offset as little-endian signed 64-bit integer and returns it.

    Due to JavaScript limitation, supports values up to 2^53-1.

    XXX: not constant-time.

    Parameters

    • array: Uint8Array
    • Default value offset: number = 0

    Returns number

readUint16BE

  • readUint16BE(array: Uint8Array, offset?: number): number
  • Reads 2 bytes from array starting at offset as big-endian unsigned 16-bit integer and returns it.

    Parameters

    • array: Uint8Array
    • Default value offset: number = 0

    Returns number

readUint16LE

  • readUint16LE(array: Uint8Array, offset?: number): number
  • Reads 2 bytes from array starting at offset as little-endian unsigned 16-bit integer and returns it.

    Parameters

    • array: Uint8Array
    • Default value offset: number = 0

    Returns number

readUint32BE

  • readUint32BE(array: Uint8Array, offset?: number): number
  • Reads 4 bytes from array starting at offset as big-endian unsigned 32-bit integer and returns it.

    Parameters

    • array: Uint8Array
    • Default value offset: number = 0

    Returns number

readUint32LE

  • readUint32LE(array: Uint8Array, offset?: number): number
  • Reads 4 bytes from array starting at offset as little-endian unsigned 32-bit integer and returns it.

    Parameters

    • array: Uint8Array
    • Default value offset: number = 0

    Returns number

readUint64BE

  • readUint64BE(array: Uint8Array, offset?: number): number
  • Reads 8 bytes from array starting at offset as big-endian unsigned 64-bit integer and returns it.

    Due to JavaScript limitation, supports values up to 2^53-1.

    Parameters

    • array: Uint8Array
    • Default value offset: number = 0

    Returns number

readUint64LE

  • readUint64LE(array: Uint8Array, offset?: number): number
  • Reads 8 bytes from array starting at offset as little-endian unsigned 64-bit integer and returns it.

    Due to JavaScript limitation, supports values up to 2^53-1.

    Parameters

    • array: Uint8Array
    • Default value offset: number = 0

    Returns number

readUintBE

  • readUintBE(bitLength: number, array: Uint8Array, offset?: number): number
  • Reads bytes from array starting at offset as big-endian unsigned bitLen-bit integer and returns it.

    Supports bit lengths divisible by 8, up to 48.

    Parameters

    • bitLength: number
    • array: Uint8Array
    • Default value offset: number = 0

    Returns number

readUintLE

  • readUintLE(bitLength: number, array: Uint8Array, offset?: number): number
  • Reads bytes from array starting at offset as little-endian unsigned bitLen-bit integer and returns it.

    Supports bit lengths divisible by 8, up to 48.

    Parameters

    • bitLength: number
    • array: Uint8Array
    • Default value offset: number = 0

    Returns number

writeFloat32BE

  • writeFloat32BE(value: number, out?: Uint8Array, offset?: number): Uint8Array
  • Writes 4-byte big-endian floating-point representation of value to byte array starting at offset.

    If byte array is not given, creates a new 4-byte one.

    Returns the output byte array.

    Parameters

    • value: number
    • Default value out: Uint8Array = new Uint8Array(4)
    • Default value offset: number = 0

    Returns Uint8Array

writeFloat32LE

  • writeFloat32LE(value: number, out?: Uint8Array, offset?: number): Uint8Array
  • Writes 4-byte little-endian floating-point representation of value to byte array starting at offset.

    If byte array is not given, creates a new 4-byte one.

    Returns the output byte array.

    Parameters

    • value: number
    • Default value out: Uint8Array = new Uint8Array(4)
    • Default value offset: number = 0

    Returns Uint8Array

writeFloat64BE

  • writeFloat64BE(value: number, out?: Uint8Array, offset?: number): Uint8Array
  • Writes 8-byte big-endian floating-point representation of value to byte array starting at offset.

    If byte array is not given, creates a new 8-byte one.

    Returns the output byte array.

    Parameters

    • value: number
    • Default value out: Uint8Array = new Uint8Array(8)
    • Default value offset: number = 0

    Returns Uint8Array

writeFloat64LE

  • writeFloat64LE(value: number, out?: Uint8Array, offset?: number): Uint8Array
  • Writes 8-byte little-endian floating-point representation of value to byte array starting at offset.

    If byte array is not given, creates a new 8-byte one.

    Returns the output byte array.

    Parameters

    • value: number
    • Default value out: Uint8Array = new Uint8Array(8)
    • Default value offset: number = 0

    Returns Uint8Array

writeUint16BE

  • writeUint16BE(value: number, out?: Uint8Array, offset?: number): Uint8Array
  • Writes 2-byte big-endian representation of 16-bit unsigned value to byte array starting at offset.

    If byte array is not given, creates a new 2-byte one.

    Returns the output byte array.

    Parameters

    • value: number
    • Default value out: Uint8Array = new Uint8Array(2)
    • Default value offset: number = 0

    Returns Uint8Array

writeUint16LE

  • writeUint16LE(value: number, out?: Uint8Array, offset?: number): Uint8Array
  • Writes 2-byte little-endian representation of 16-bit unsigned value to array starting at offset.

    If byte array is not given, creates a new 2-byte one.

    Returns the output byte array.

    Parameters

    • value: number
    • Default value out: Uint8Array = new Uint8Array(2)
    • Default value offset: number = 0

    Returns Uint8Array

writeUint32BE

  • writeUint32BE(value: number, out?: Uint8Array, offset?: number): Uint8Array
  • Writes 4-byte big-endian representation of 32-bit unsigned value to byte array starting at offset.

    If byte array is not given, creates a new 4-byte one.

    Returns the output byte array.

    Parameters

    • value: number
    • Default value out: Uint8Array = new Uint8Array(4)
    • Default value offset: number = 0

    Returns Uint8Array

writeUint32LE

  • writeUint32LE(value: number, out?: Uint8Array, offset?: number): Uint8Array
  • Writes 4-byte little-endian representation of 32-bit unsigned value to array starting at offset.

    If byte array is not given, creates a new 4-byte one.

    Returns the output byte array.

    Parameters

    • value: number
    • Default value out: Uint8Array = new Uint8Array(4)
    • Default value offset: number = 0

    Returns Uint8Array

writeUint64BE

  • writeUint64BE(value: number, out?: Uint8Array, offset?: number): Uint8Array
  • Writes 8-byte big-endian representation of 64-bit unsigned value to byte array starting at offset.

    Due to JavaScript limitation, supports values up to 2^53-1.

    If byte array is not given, creates a new 8-byte one.

    Returns the output byte array.

    Parameters

    • value: number
    • Default value out: Uint8Array = new Uint8Array(8)
    • Default value offset: number = 0

    Returns Uint8Array

writeUint64LE

  • writeUint64LE(value: number, out?: Uint8Array, offset?: number): Uint8Array
  • Writes 8-byte little-endian representation of 64-bit unsigned value to byte array starting at offset.

    Due to JavaScript limitation, supports values up to 2^53-1.

    If byte array is not given, creates a new 8-byte one.

    Returns the output byte array.

    Parameters

    • value: number
    • Default value out: Uint8Array = new Uint8Array(8)
    • Default value offset: number = 0

    Returns Uint8Array

writeUintBE

  • writeUintBE(bitLength: number, value: number, out?: Uint8Array, offset?: number): Uint8Array
  • Writes a big-endian representation of bitLen-bit unsigned value to array starting at offset.

    Supports bit lengths divisible by 8, up to 48.

    If byte array is not given, creates a new one.

    Returns the output byte array.

    Parameters

    • bitLength: number
    • value: number
    • Default value out: Uint8Array = new Uint8Array(bitLength / 8)
    • Default value offset: number = 0

    Returns Uint8Array

writeUintLE

  • writeUintLE(bitLength: number, value: number, out?: Uint8Array, offset?: number): Uint8Array
  • Writes a little-endian representation of bitLen-bit unsigned value to array starting at offset.

    Supports bit lengths divisible by 8, up to 48.

    If byte array is not given, creates a new one.

    Returns the output byte array.

    Parameters

    • bitLength: number
    • value: number
    • Default value out: Uint8Array = new Uint8Array(bitLength / 8)
    • Default value offset: number = 0

    Returns Uint8Array

Generated using TypeDoc