pamoja for TypeScript - v0.1.17
    Preparing search index...

    Class Quantizer

    Packs float readings to a fixed precision for a metered link.

    Index
    • Creates a quantizer whose scale sets the precision kept.

      A scale of 100 keeps two decimal places. It must be positive and finite, and decoding must use the same scale the batch was encoded with.

      Parameters

      • scale: number

      Returns Quantizer

    • Decodes a batch back into readings, to within the quantizer's precision.

      Parameters

      • bytes: Buffer

      Returns number[]

    • Quantizes and delta-encodes a batch of readings.

      Parameters

      • readings: number[]

      Returns Buffer