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

本文介绍了Fingerprintjs2,一个强大的开源设备指纹采集工具,详细阐述了其工作原理和使用方法,帮助读者理解如何集成到项目中进行设备识别。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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();
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值