FP-Devicer - v2.0.2
    Preparing search index...

    Interface LshIndex

    In-memory Locality-Sensitive Hashing index over set-valued fingerprint fields (fonts, plugins, mimeTypes, languages).

    Devices whose token sets share a MinHash band bucket are returned as candidates, providing O(n/b) average-case candidate retrieval where n is the total number of indexed fingerprints and b is the number of bands.

    The similarity threshold at which two fingerprints become near-certain candidates is approximately t ≈ (1/numBands)^(1/rowsPerBand). With the defaults (128 hashes, 16 bands, 8 rows/band): t ≈ 0.50.

    interface LshIndex {
        add(deviceId: string, fp: FPUserDataSet): void;
        clear(): void;
        query(fp: FPUserDataSet): string[];
        remove(deviceId: string): void;
        size(): number;
    }
    Index

    Methods

    • Index a fingerprint under the given deviceId. Calling add for the same deviceId again adds signature entries; it does NOT replace them. Use remove first to replace an existing entry.

      Parameters

      Returns void

    • Return device IDs whose band buckets overlap with the query fingerprint. An empty array is returned when the query token set is empty.

      Parameters

      Returns string[]

    • Remove all band-bucket entries for the given deviceId.

      Parameters

      • deviceId: string

      Returns void

    • Number of deviceId → fingerprint associations currently indexed. (One device may cover multiple fingerprints if add is called multiple times for the same ID.)

      Returns number