Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • RICUtils

Index

Constructors

Properties

_isEndianSet: boolean = false
_isLittleEndian: boolean = false

Methods

  • addStringToBuffer(buffer: Uint8Array, strToAdd: string, startPos: number): void
  • Add a string to a Uint8Array buffer

    Parameters

    • buffer: Uint8Array

      buffer to add to

    • strToAdd: string

      string to be added

    • startPos: number

      start position in buffer (i.e. offset to place string at)

    Returns void

  • atob(data: string): null | Uint8Array
  • Implementation of atob() according to the HTML and Infra specs, except that instead of throwing INVALID_CHARACTER_ERR we return null.

    Parameters

    • data: string

      string containing base64 representation

    Returns null | Uint8Array

    Uint8Array

  • atobLookup(chr: string): undefined | number
  • A lookup table for atob(), which converts an ASCII character to the corresponding six-bit number.

    Parameters

    • chr: string

    Returns undefined | number

  • btoa(inBuf: Uint8Array): string
  • btoa() as defined by the HTML and Infra specs, which mostly just references RFC 4648.

    Parameters

    • inBuf: Uint8Array

    Returns string

    string containing base64 representation

  • btoaLookup(idx: undefined | number): undefined | string
  • Lookup table for btoa(), which converts a six-bit number into the corresponding ASCII character.

    Parameters

    • idx: undefined | number

    Returns undefined | string

  • buf2hex(buffer: Uint8Array): string
  • bufferToHex(buffer: null | Uint8Array): string
  • Debug code to format a Uint8Array to string for logging

    Parameters

    • buffer: null | Uint8Array

      Uint8Array to be converted to hex string

    Returns string

  • getBEFloatFromBuf(buf: Uint8Array): number
  • Extract a big-endian float from a uint8array

    Parameters

    • buf: Uint8Array

      Uint8Array containing float

    Returns number

    float

  • getBEInt16FromBuf(buf: Uint8Array, bufPos: number): number
  • Extract a big-endian int16 from a uint8array

    Parameters

    • buf: Uint8Array

      Uint8Array containing int16

    • bufPos: number

    Returns number

    int16

  • getBEInt8FromBuf(buf: Uint8Array, pos: number): number
  • Extract a big-endian int8 from a uint8array

    Parameters

    • buf: Uint8Array

      Uint8Array containing int8

    • pos: number

      position (offset in buf) to get from

    Returns number

    int16

  • getBEUint16FromBuf(buf: Uint8Array, bufPos: number): number
  • Extract a big-endian uint16 from a uint8array

    Parameters

    • buf: Uint8Array

      Uint8Array containing uint16

    • bufPos: number

    Returns number

    int16

  • getBEUint32FromBuf(buf: Uint8Array, bufPos: number): number
  • Extract a big-endian uint16 from a uint8array

    Parameters

    • buf: Uint8Array

      Uint8Array containing uint16

    • bufPos: number

    Returns number

    int16

  • getBEUint8FromBuf(buf: Uint8Array, pos: number): number
  • Extract a big-endian uint8 from a uint8array

    Parameters

    • buf: Uint8Array

      Uint8Array containing uint8

    • pos: number

      position (offset in buf) to get from

    Returns number

    int16

  • getStringFromBuffer(buffer: Uint8Array, startPos: number, strLen: number): string
  • Get a string from a Uint8Array buffer

    Parameters

    • buffer: Uint8Array

      buffer to get from

    • startPos: number

      start position in buffer (i.e. offset to start of string at)

    • strLen: number

      length of string to get

    Returns string

    strGot - string got from buffer

  • isLittleEndian(): boolean
  • isVersionEqual(v1: string, v2: string): boolean
  • isVersionGreater(v1: string, v2: string): boolean
  • padStartFn(inStr: string, targetLength: number, padString: string): string
  • Parameters

    • inStr: string
    • targetLength: number
    • padString: string

    Returns string

  • withTimeout(ms: number, promise: Promise<any>): Promise<any>
  • Parameters

    • ms: number
    • promise: Promise<any>

    Returns Promise<any>

Generated using TypeDoc