/*! * Copyright (c) 2025 Akshat Kotpalliwar (alias IntegerAlex on GitHub) * This software is licensed under the GNU Lesser General Public License (LGPL) v3 or later. * * You are free to use, modify, and redistribute this software, but modifications must also be licensed under the LGPL. * This project is distributed without any warranty; see the LGPL for more details. * * For a full copy of the LGPL and ethical contribution guidelines, please refer to the `COPYRIGHT.md` and `NOTICE.md` files. */ import type { AudioEnhanced, CanvasEnhanced, WebGL2Enhanced, SpoofingInfo, EnhancedFingerprintInfo } from './types'; /** * Semantic version string for the enhanced fingerprint feature-set. * Increment when the set of collected signals changes in a way that would * alter the resulting hash for the same physical device. */ export declare const FP_VERSION = "1.0.0"; /** * Returns an enhanced audio fingerprint using `OfflineAudioContext`. * * Unlike the baseline implementation which relies on the online AudioContext * (whose output can be influenced by system-level audio latency), this * function pre-renders a fixed-length audio buffer entirely in software. * The resulting sample sum is therefore deterministic across page loads on * the same device, and the compressor gain-reduction value provides an * additional independent signal. * * Noise detection: some privacy tools inject random offsets into each rendered * sample. We detect this by comparing the `getChannelData` slice against a * `copyFromChannel` slice – if they diverge, the audio is being tampered with. * * @returns AudioEnhanced object or null when OfflineAudioContext is unavailable. */ export declare function getEnhancedAudioFingerprint(): Promise; /** * Returns a noise-stabilised canvas fingerprint hash. * * Browsers like Brave and Firefox (with resistance.fingerprinting) add * small random offsets to canvas pixels on each call to defeat naive * single-sample fingerprinting. By rendering the same scene multiple * times and taking the *most common* byte value per pixel channel, we * recover the deterministic underlying values while discarding the noise. * * The stable pixel array is then SHA-256 hashed for a compact, fixed-length * identifier that fits comfortably in the overall fingerprint object. */ export declare function getEnhancedCanvasFingerprint(): Promise; /** * Extracts high-entropy signals from the WebGL2 API. * * WebGL1 vendor/renderer strings are the most commonly spoofed WebGL * signals. WebGL2 exposes additional implementation limits and precision * formats that are less frequently targeted by anti-fingerprint tools * because they reflect deep GPU driver behaviour rather than a simple string. * * Collected signals: * - MAX_TEXTURE_SIZE / MAX_VIEWPORT_DIMS / MAX_RENDERBUFFER_SIZE * – GPU capability flags that differ between hardware generations. * - Shader precision formats (vertex + fragment, high float) * – expose whether the GPU uses 32-bit or higher-precision floats. * - Supported extension list (hashed) – varies by driver version/vendor. */ export declare function getEnhancedWebGL2Info(): Promise; /** * Detects signals that indicate a headless browser, automation framework, or * active anti-fingerprinting extension. * * The check categories: * * **Headless signals** — properties that headless Chromium/Puppeteer/Playwright * typically expose but are absent in real user agents: * - Missing `window.chrome` in a Blink-based UA * - `navigator.webdriver === true` * - `navigator.pdfViewerEnabled === false` (headless Chromium default) * - Notification permission is `denied` without a real prompt * - `screen.height === screen.availHeight` (no system taskbar) * - `visualViewport` dimensions match `screen` exactly * - SwiftShader or LLVMpipe renderer (software rendering, no GPU) * - `userAgentData.platform` is an empty string * * **Anti-fingerprint signals** — indicate a tool is actively modifying APIs: * - `navigator.languages` is empty or blocked * - `navigator.plugins.length === 0` in a Blink-based UA * - `navigator.mimeTypes.length === 0` in a Blink-based UA * * Each detected signal is appended to the `signals` array. A weighted score * is computed; signals most diagnostic of headless environments are weighted * higher than weak indicators. */ export declare function detectSpoofing(): SpoofingInfo; /** * Returns a rough estimate of how much entropy each collected signal * contributes to the overall fingerprint. * * Entropy estimates are based on empirically observed variation across a * large population of real browsers (order-of-magnitude approximations). * * @param enhanced - The collected EnhancedFingerprintInfo object. * @returns A map from signal name to estimated bits of entropy. */ export declare function computeEntropyScores(enhanced: EnhancedFingerprintInfo): Record; /** * Collects all enhanced fingerprint signals in parallel and returns the * complete `EnhancedFingerprintInfo` object. * * This is the primary entry point called from `getSystemInfo`. */ export declare function collectEnhancedFingerprint(): Promise;