<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.multitheftauto.com/wiki/Fingerprint?action=history&amp;feed=atom</id>
	<title>Fingerprint - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.multitheftauto.com/wiki/Fingerprint?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Fingerprint&amp;action=history"/>
	<updated>2026-04-27T11:46:27Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://wiki.multitheftauto.com/index.php?title=Fingerprint&amp;diff=78618&amp;oldid=prev</id>
		<title>Mtaowner: Created page with &quot;{{Useful Function}} __NOTOC__ This function calculates a fingerprint unique to each computer.  ==Syntax== &lt;syntaxhighlight lang=&quot;lua&quot;&gt; void fingerprint ( function callback ) &lt;/syntaxhighlight&gt;  ===Required arguments=== *'''callback''': a callback function with syntax as described below  ====Callback syntax==== &lt;syntaxhighlight lang=&quot;lua&quot;&gt; function ( int value ) &lt;/syntaxhighlight&gt;  ==Code== &lt;section name=&quot;Code&quot; class=&quot;client&quot; show=&quot;true&quot;&gt; &lt;syntaxhighlight lang=&quot;lua&quot;&gt; func...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.multitheftauto.com/index.php?title=Fingerprint&amp;diff=78618&amp;oldid=prev"/>
		<updated>2023-11-21T14:31:08Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Useful Function}} __NOTOC__ This function calculates a fingerprint unique to each computer.  ==Syntax== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; void fingerprint ( function callback ) &amp;lt;/syntaxhighlight&amp;gt;  ===Required arguments=== *&amp;#039;&amp;#039;&amp;#039;callback&amp;#039;&amp;#039;&amp;#039;: a callback function with syntax as described below  ====Callback syntax==== &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; function ( int value ) &amp;lt;/syntaxhighlight&amp;gt;  ==Code== &amp;lt;section name=&amp;quot;Code&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt; &amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt; func...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Useful Function}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This function calculates a fingerprint unique to each computer.&lt;br /&gt;
&lt;br /&gt;
==Syntax==&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
void fingerprint ( function callback )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Required arguments===&lt;br /&gt;
*'''callback''': a callback function with syntax as described below&lt;br /&gt;
&lt;br /&gt;
====Callback syntax====&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function ( int value )&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Code&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
function fingerprint(callback)&lt;br /&gt;
    assert(type(callback) == 'function', 'Bad argument @ fingerprint [Expected function at argument 1, got '..type(callback)..']')&lt;br /&gt;
    local browser = createBrowser(1, 1, true, true)&lt;br /&gt;
    addEventHandler('onClientBrowserDocumentReady', browser, function()&lt;br /&gt;
        local num = tonumber(getBrowserTitle(browser) or 0) or 0&lt;br /&gt;
        destroyElement(browser)&lt;br /&gt;
        callback(num)&lt;br /&gt;
    end)&lt;br /&gt;
    addEventHandler('onClientBrowserLoadingFailed', browser, function()&lt;br /&gt;
        destroyElement(browser)&lt;br /&gt;
        callback(0)&lt;br /&gt;
    end)&lt;br /&gt;
    addEventHandler('onClientBrowserCreated', browser, function()&lt;br /&gt;
        loadBrowserURL(browser, 'http://mta/local/')&lt;br /&gt;
        executeBrowserJavascript(browser, [[for(canvas=document.createElement(&amp;quot;canvas&amp;quot;),ctx=canvas.getContext(&amp;quot;2d&amp;quot;),txt=&amp;quot;i9asdm..$#po((^@KbXrww!~cz&amp;quot;,ctx.textBaseline=&amp;quot;top&amp;quot;,ctx.font=&amp;quot;16px 'Arial'&amp;quot;,ctx.textBaseline=&amp;quot;alphabetic&amp;quot;,ctx.rotate(.05),ctx.fillStyle=&amp;quot;#f60&amp;quot;,ctx.fillRect(125,1,62,20),ctx.fillStyle=&amp;quot;#069&amp;quot;,ctx.fillText(txt,2,15),ctx.fillStyle=&amp;quot;rgba(102, 200, 0, 0.7)&amp;quot;,ctx.fillText(txt,4,17),ctx.shadowBlur=10,ctx.shadowColor=&amp;quot;blue&amp;quot;,ctx.fillRect(-20,10,234,5),ctx.fillStyle=&amp;quot;rgb(255,0,253)&amp;quot;,ctx.beginPath(),ctx.rect(20.00000000000001,20.9999999999899,151.50000158115816,100.5445545401),ctx.fill(),ctx.stroke(),ctx.closePath(),ctx.beginPath(),ctx.fillStyle=&amp;quot;rgb(0,254.66666666666,255)&amp;quot;,ctx.arc(50.87401107072145,50.74810746,50.01010101,0,.1111111*Math.PI,!0),ctx.fill(),ctx.stroke(),ctx.closePath(),txt=&amp;quot;abz190#$%^@£éú&amp;quot;,ctx.textBaseline=&amp;quot;top&amp;quot;,ctx.font='17px &amp;quot;Arial 17&amp;quot;',ctx.textBaseline=&amp;quot;alphabetic&amp;quot;,ctx.fillStyle=&amp;quot;rgb(255,5.5555555,5)&amp;quot;,ctx.rotate(.03),ctx.fillText(txt,4,17),ctx.fillStyle=&amp;quot;rgb(155,255,5)&amp;quot;,ctx.shadowBlur=8,ctx.shadowColor=&amp;quot;red&amp;quot;,ctx.fillRect(20,12.987654321,100.123456789,5),src=canvas.toDataURL(),hash=0,i=0;i&amp;lt;src.length;i++)char=src.charCodeAt(i),hash=(hash&amp;lt;&amp;lt;5)-hash+char,hash&amp;amp;=hash;document.title=hash;]])&lt;br /&gt;
    end)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Example==&lt;br /&gt;
&amp;lt;section name=&amp;quot;Example&amp;quot; class=&amp;quot;client&amp;quot; show=&amp;quot;true&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
addEventHandler('onClientResourceStart', resourceRoot, function()&lt;br /&gt;
    fingerprint(function(num)&lt;br /&gt;
        outputChatBox('fingerprint: '..num)&lt;br /&gt;
        setElementData(localPlayer, 'fingerprint', num)&lt;br /&gt;
    end)&lt;br /&gt;
end, false)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&amp;lt;/section&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
{{Useful_Functions}}&lt;/div&gt;</summary>
		<author><name>Mtaowner</name></author>
	</entry>
</feed>