master
iotcat 4 years ago
parent affc0cddef
commit a176a91ff7
  1. 36
      dist/fp.js
  2. 2
      dist/fp.min.js
  3. 2
      dist/fp.min.js.map
  4. 36
      fp.js

36
dist/fp.js vendored

@ -1488,6 +1488,7 @@
var startTime = new Date().valueOf();
var options_low = {
excludes: {
"userAgent": true,
'enumerateDevices': true,
'pixelRatio': true,
'doNotTrack': true,
@ -1504,6 +1505,21 @@
"audio": true
}
};
var options_mid = {
excludes: {
'enumerateDevices': true,
'pixelRatio': true,
'doNotTrack': true,
'fontsFlash': true,
'fonts': true,
'language': true,
"availableScreenResolution": true,
"timezoneOffset": true,
"timezone": true,
"plugins": true,
"adBlock": true,
}
};
var options_high = {
excludes: {
'enumerateDevices': true,
@ -1526,21 +1542,31 @@
}
}
var getLowFp = function(highFp, components, resolve, reject){
var lowFp = Fingerprint2.x64hash128(JSON.stringify(components), 15).substring(0, 4);
var fullFp = lowFp + highFp;
var getLowFp = function(highFp, midFp, components, resolve, reject){
var lowFp = Fingerprint2.x64hash128(JSON.stringify(components), 15).substring(0, 2);
var fullFp = lowFp + midFp + highFp;
console.log('\n' + ' %c fp v3.0.1 %c ' + fullFp + '::' + (new Date().valueOf() - startTime) + 'ms %c https://fp.yimian.xyz/ \n', 'color: #00FFFF; background: #030307; padding:5px 0;', 'color: #fadfa3; background: #030307; padding:5px 0;', 'background: #4682B4; padding:5px 0;');
resolve(fullFp);
}
var getMidFp = function(highFp, components, resolve, reject){
var midFp = Fingerprint2.x64hash128(JSON.stringify(components), 15).substring(0, 2);
components.forEach(function(obj, index){
if(options_low.excludes.hasOwnProperty(obj.key)){
components.splice(index, 1);
}
});
getLowFp(highFp, midFp, components, resolve, reject);
}
var getHighFp = function(components, resolve, reject){
var highFp = Fingerprint2.x64hash128(JSON.stringify(components), 15).substring(0, 2);
components.forEach(function(obj, index){
if(options_high.excludes.hasOwnProperty(obj.key)){
if(options_mid.excludes.hasOwnProperty(obj.key)){
components.splice(index, 1);
}
});
getLowFp(highFp, components, resolve, reject);
getMidFp(highFp, components, resolve, reject);
}
return new Promise(function(resolve, reject){

2
dist/fp.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

36
fp.js

@ -1488,6 +1488,7 @@
var startTime = new Date().valueOf();
var options_low = {
excludes: {
"userAgent": true,
'enumerateDevices': true,
'pixelRatio': true,
'doNotTrack': true,
@ -1504,6 +1505,21 @@
"audio": true
}
};
var options_mid = {
excludes: {
'enumerateDevices': true,
'pixelRatio': true,
'doNotTrack': true,
'fontsFlash': true,
'fonts': true,
'language': true,
"availableScreenResolution": true,
"timezoneOffset": true,
"timezone": true,
"plugins": true,
"adBlock": true,
}
};
var options_high = {
excludes: {
'enumerateDevices': true,
@ -1526,21 +1542,31 @@
}
}
var getLowFp = function(highFp, components, resolve, reject){
var lowFp = Fingerprint2.x64hash128(JSON.stringify(components), 15).substring(0, 4);
var fullFp = lowFp + highFp;
var getLowFp = function(highFp, midFp, components, resolve, reject){
var lowFp = Fingerprint2.x64hash128(JSON.stringify(components), 15).substring(0, 2);
var fullFp = lowFp + midFp + highFp;
console.log('\n' + ' %c fp v3.0.1 %c ' + fullFp + '::' + (new Date().valueOf() - startTime) + 'ms %c https://fp.yimian.xyz/ \n', 'color: #00FFFF; background: #030307; padding:5px 0;', 'color: #fadfa3; background: #030307; padding:5px 0;', 'background: #4682B4; padding:5px 0;');
resolve(fullFp);
}
var getMidFp = function(highFp, components, resolve, reject){
var midFp = Fingerprint2.x64hash128(JSON.stringify(components), 15).substring(0, 2);
components.forEach(function(obj, index){
if(options_low.excludes.hasOwnProperty(obj.key)){
components.splice(index, 1);
}
});
getLowFp(highFp, midFp, components, resolve, reject);
}
var getHighFp = function(components, resolve, reject){
var highFp = Fingerprint2.x64hash128(JSON.stringify(components), 15).substring(0, 2);
components.forEach(function(obj, index){
if(options_high.excludes.hasOwnProperty(obj.key)){
if(options_mid.excludes.hasOwnProperty(obj.key)){
components.splice(index, 1);
}
});
getLowFp(highFp, components, resolve, reject);
getMidFp(highFp, components, resolve, reject);
}
return new Promise(function(resolve, reject){

Loading…
Cancel
Save