Fingerprintjs2:一款开源设备指纹采集器,生成浏览器唯一标识符

239次阅读
没有评论

介绍:
Fingerprintjs2 是一款开源的设备指纹采集器。最初的 fingerprintjs 库创建于 2012 年,但是由于新版本的开发很难保持向后兼容,因此 Fingerprintjs2 项目中增加了很多的新内容。

该项目将更多、更有效的来源用于指纹识别,并且可配置,也就是说用户可以选择性地开启其中的选项。该项目还将重点关注 IE 插件,尤其是在中国流行的 QQ、Baidu 等。另外,该项目使用了 semver(语义化的版本控制系统)。

文章原文:https://www.jianshu.com/p/7e8499655f9a

更多使用介绍:http://www.freebuf.com/sectool/105353.html

GitHub 项目地址:https://github.com/Valve/fingerprintjs2

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/fingerprintjs2/1.5.1/fingerprint2.min.js"></script>

<script>

    new Fingerprint2().get(function(result, components){alert(result);
        console.log(result); //a hash, representing your device fingerprint
        console.log(components); // an array of FP components
    });

</script>
 调用方法

var fingerprint = new Fingerprint().get();
如果你想使用 Canvas FingerPrinting,则如下调用:var fingerprint = new Fingerprint({canvas: true}).get();
如果你想使用屏幕分辨率计算指纹,则需如下调用:var fingerprint = new Fingerprint({screen_resolution: true}).get();
使用自定义的哈希函数

var my_hasher = new function(value, seed){return value.length % seed; };
var fingerprint = new Fingerprint({hasher: my_hasher}).get();
或者直接传递方法:var my_hasher = new function(value, seed){return value.length % seed; };
var fingerprint = new Fingerprint(my_hasher).get();
正文完
有偿技术支持加微信
post-qrcode
 
评论(没有评论)
验证码