added fingerprint lib
This commit is contained in:
parent
be194d2dd0
commit
3442152521
6 changed files with 2250 additions and 1 deletions
|
|
@ -1,3 +1,4 @@
|
|||
// reformat geo: links based on platform
|
||||
const ua = String(platform.os).toLowerCase();
|
||||
const android = ua.indexOf("android") > -1;
|
||||
const ios = ua.indexOf("ios") > -1;
|
||||
|
|
@ -16,4 +17,31 @@ if ( hasharray.length > 0 ) {
|
|||
else if ( android ) hashlink.href = "geo:0,0?q=" + latlon;
|
||||
else if ( ios ) hashlink.href = "http://maps.apple.com/?ll=" + latlon + "&q=" + hashlink.innerHTML;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// fingerprint user
|
||||
const EncryptDecrypt_1 = require("./code/EncryptDecrypt");
|
||||
const GenerateCanvasFingerprint_1 = require("./code/GenerateCanvasFingerprint");
|
||||
const generateTheAudioPrints_1 = require("./code/generateTheAudioPrints");
|
||||
const getCurrentBrowserFingerPrint = () => {
|
||||
const getTheAudioPrints = new Promise((resolve, reject) => {
|
||||
generateTheAudioPrints_1.generateTheAudioFingerPrint.run(function (fingerprint) {
|
||||
resolve(fingerprint);
|
||||
});
|
||||
});
|
||||
const DevicePrints = new Promise((resolve, reject) => {
|
||||
getTheAudioPrints.then((audioChannelResult) => {
|
||||
let fingerprint = window.btoa(audioChannelResult) + (0, GenerateCanvasFingerprint_1.getCanvasFingerprint)();
|
||||
resolve((0, EncryptDecrypt_1.cyrb53)(fingerprint, 0));
|
||||
}).catch(() => {
|
||||
try {
|
||||
resolve((0, EncryptDecrypt_1.cyrb53)((0, GenerateCanvasFingerprint_1.getCanvasFingerprint)()).toString());
|
||||
}
|
||||
catch (error) {
|
||||
reject("Failed to generate the finger print of this browser");
|
||||
}
|
||||
});
|
||||
});
|
||||
return DevicePrints;
|
||||
};
|
||||
exports.getCurrentBrowserFingerPrint = getCurrentBrowserFingerPrint;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue