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

http://www.freebuf.com/sectool/105353.html

<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();

你可能感兴趣的:(指纹采集器)