<%
user_agent = UserAgent.parse(request.user_agent)

$id_vars[:os] = user_agent.os
$id_vars[:platform] = user_agent.platform
$id_vars[:browser] = user_agent.browser
$id_vars[:version] = user_agent.version
$id_vars[:build] = user_agent.build
$id_vars[:localization] = user_agent.localization

id_json =$id_vars.to_json
id_md5 = Digest::MD5.hexdigest(id_json)

$redis.incr(id_md5) unless cookies[:open_panopticlick]
id_match = $redis.get(id_md5)
id_total = $redis.keys.count

cookies[:open_panopticlick] = 'locked'
%>

<table class="table table-bordered table-condensed">
  <tr><td>Fingerprint</td><td class="text-center"><%=id_md5%></td></tr>
  <tr><td>Uniqueness</td><td class="text-center"><%="#{id_match} / #{id_total}"%></td></tr>
</table>

<small><%=id_json%></small>

<%
user_agent = UserAgent.parse(request.user_agent)

$id_vars[:os] = user_agent.os
$id_vars[:platform] = user_agent.platform
$id_vars[:browser] = user_agent.browser
$id_vars[:version] = user_agent.version
$id_vars[:build] = user_agent.build
$id_vars[:localization] = user_agent.localization

id_json =$id_vars.to_json
id_md5 = Digest::MD5.hexdigest(id_json)

$redis.incr(id_md5) unless cookies[:open_panopticlick]
id_match = $redis.get(id_md5)
id_total = $redis.keys.count

cookies[:open_panopticlick] = 'locked'
%>

<table class="table table-bordered table-condensed">
  <tr><td>Fingerprint</td><td class="text-center"><%=id_md5%></td></tr>
  <tr><td>Uniqueness</td><td class="text-center"><%="#{id_match} / #{id_total}"%></td></tr>
</table>

<hr>

<h3>About:</h3>
<p>In 2010 the <a href="https://www.eff.org/">Electronic Frontier Foundation (EFF)</a> announced <a href="https://panopticlick.eff.org/">Panopticlick</a>, a web application designed to identify unique users by fingerprinting their web browsers.</p>
<p>In 2013 after Panopticlick was reposted <sup><small>(Again...)</small></sup> on <a href="https://news.ycombinator.com/">Hacker News</a>, I became curious about how exactly some parts of it worked. On discovering that the EFF have never published any source code for Panopticlick, I decided to create a FOSS (GPLv3) reimplementation.</p>

Add 'About', remove debug output
Add 'About', remove debug output
