A lightweight JavaScript library for generating unique device fingerprints with both client-side and server-side support
npm install hashed-device-fingerprint-js
Uses advanced hashing algorithms to generate unique device fingerprints
Generate fingerprints on both client and server environments
Simple API for quick implementation in any JavaScript project
import { generateHashedFingerprint } from 'hashed-device-fingerprint-js';
// Generate a unique device fingerprint
generateHashedFingerprint()
.then(hash => console.log('Fingerprint Hash:', hash))
.catch(error => console.error('Error:', error));
import { generateHashedFingerprint } from 'hashed-device-fingerprint-js';
generateHashedFingerprint({
useUserAgent: true, // Include the user agent (default: true)
useLanguage: false, // Exclude the browser language
useScreenResolution: true, // Include screen resolution (default: true)
usePlatform: true, // Include platform information (default: true)
useConcurrency: true, // Include logical processors (default: true)
useIP: true, // Fetch and include the user's IP (default: true)
userIP: '203.0.113.45', // Provide IP manually (overrides API fetch)
saveToCookie: false, // Do not save the hash in a cookie (default: true)
cookieExpiryDays: 10 // Cookie expiry in days (default: 7)
})
.then(hash => console.log('Custom Fingerprint Hash:', hash))
.catch(error => console.error('Error:', error));