美文网首页
Fingerprintjs2:一款开源设备指纹采集器

Fingerprintjs2:一款开源设备指纹采集器

作者: wtfysa | 来源:发表于2017-10-19 11:39 被阅读2568次

http://www.freebuf.com/sectool/105353.html
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>
调用方法
1
var fingerprint = new Fingerprint().get();
如果你想使用 Canvas FingerPrinting,则如下调用:
1
var fingerprint = new Fingerprint({canvas: true}).get();
如果你想使用屏幕分辨率计算指纹,则需如下调用:
1
var fingerprint = new Fingerprint({screen_resolution: true}).get();
使用自定义的哈希函数
1
2
var my_hasher = new function(value, seed){ return value.length % seed; };
var fingerprint = new Fingerprint({hasher: my_hasher}).get();
或者直接传递方法:
1
2
var my_hasher = new function(value, seed){ return value.length % seed; };
var fingerprint = new Fingerprint(my_hasher).get();

相关文章

网友评论

      本文标题:Fingerprintjs2:一款开源设备指纹采集器

      本文链接:https://www.haomeiwen.com/subject/wmluuxtx.html