@zaplier/sdk 1.0.6 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/sdk.js CHANGED
@@ -157,8 +157,12 @@
157
157
  h1 = x64Add(h1, h2);
158
158
  h2 = x64Add(h2, h1);
159
159
  // Convert to hex string
160
- const hex1 = h1[0].toString(16).padStart(8, "0") + h1[1].toString(16).padStart(8, "0");
161
- const hex2 = h2[0].toString(16).padStart(8, "0") + h2[1].toString(16).padStart(8, "0");
160
+ // CRITICAL: Use >>> 0 to convert to unsigned 32-bit integer before converting to hex
161
+ // This prevents negative numbers from generating hashes with minus signs (e.g., "-6b43973f")
162
+ const hex1 = (h1[0] >>> 0).toString(16).padStart(8, "0") +
163
+ (h1[1] >>> 0).toString(16).padStart(8, "0");
164
+ const hex2 = (h2[0] >>> 0).toString(16).padStart(8, "0") +
165
+ (h2[1] >>> 0).toString(16).padStart(8, "0");
162
166
  return hex1 + hex2;
163
167
  }
164
168
  /**
@@ -5979,10 +5983,29 @@
5979
5983
  // - Exact hardware values (use buckets)
5980
5984
  // Generate ultra-stable hash with additional collision resistance
5981
5985
  const stableCoreHash = hashStableCore(coreVector, opts.debug);
5982
- // CRITICAL: Generate enhanced fingerprint hash combining unstable + stable components
5983
- // This prevents collisions by adding stable entropy to the fingerprint hash
5986
+ // CRITICAL: Generate enhanced fingerprint hash combining STABLE components only
5987
+ // Filter out unstable components that change between requests (canvas, webgl, audio)
5988
+ // These components can vary due to GPU state, rendering context, permissions, etc.
5989
+ const unstableComponentKeys = [
5990
+ "canvas",
5991
+ "webgl",
5992
+ "audio", // Visual/audio fingerprints (vary with context)
5993
+ "mathFingerprint",
5994
+ "fontPreferences",
5995
+ "enhancedFonts", // Measurement-based (can timeout/vary)
5996
+ "dateTimeLocale",
5997
+ "accessibilityEnhanced", // Locale/accessibility (can change)
5998
+ "domBlockers",
5999
+ "pluginsEnhanced", // Privacy tools detection (can change)
6000
+ ];
6001
+ const stableComponentValues = {};
6002
+ for (const [key, value] of Object.entries(componentValues)) {
6003
+ if (!unstableComponentKeys.includes(key)) {
6004
+ stableComponentValues[key] = value;
6005
+ }
6006
+ }
5984
6007
  const enhancedComponentValues = {
5985
- ...componentValues, // Unstable components (canvas, webgl, audio, etc.)
6008
+ ...stableComponentValues, // STABLE components only (screen, browser, system, etc.)
5986
6009
  _stableCore: coreVector, // + Ultra-stable components (ua, platform, deviceType, etc.)
5987
6010
  // REMOVED: _hourlyEntropy - was causing visitor ID instability (same user = different IDs)
5988
6011
  };