Documentation
    Preparing search index...

    Interface Checksum

    An incremental FNV-1a hasher over quantized floats.

    The digest depends on the values and their insertion order; feeding the same sequence to two hashers always yields the same digest.

    interface Checksum {
        addFloat(x: number): void;
        addFloats(xs: Iterable<number>): void;
        digest(): number;
    }
    Index
    • Absorbs one value.

      Parameters

      • x: number

      Returns void

      RangeError if x is NaN, infinite, or quantizes outside the 53-bit-safe integer range.

    • Absorbs every value of xs in iteration order.

      Parameters

      • xs: Iterable<number>

      Returns void

      RangeError on the first unusable value; values already absorbed stay absorbed, so a hasher that threw should be discarded.

    • The current digest as a uint32.

      Non-destructive: FNV-1a has no finalization step, so the hasher may keep absorbing values afterwards and digest() may be called repeatedly.

      Returns number