新聞中心
一、什么是瀏覽器設(shè)備指紋?
第二代指紋追蹤是設(shè)備指紋技術(shù),發(fā)現(xiàn) IP 背后的設(shè)備。通過 js 獲取操作系統(tǒng)、分辨率、像素比等等一系列信息,傳到后臺(tái)計(jì)算,然后歸并設(shè)備。
唯一性可以保證,但準(zhǔn)確率很難完全保證。主要原因就是在跨瀏覽器指紋識(shí)別上面??鐬g覽器之后,第二代技術(shù)中很重要的 canvas 指紋、瀏覽器插件指紋都變了,所以很難把跨瀏覽器指紋歸并到同一設(shè)備上。
(這是從網(wǎng)上找的比較容易理解的解釋)
二、如何使用?
https://github.com/fingerprintjs/fingerprintjsyhttps://github.com/fingerprintjs/fingerprintjs我用的是這個(gè)開源的代碼,點(diǎn)進(jìn)去會(huì)有教程教你怎么使用的。以下是我的使用代碼:
? const fpPromise = import('https://openfpcdn.io/fingerprintjs/v3')
? .then(FingerprintJS =>FingerprintJS.load())
? // Get the visitor identifier when you need it.
? fpPromise
? .then(fp =>fp.get())
? .then(result =>{
? // This is the visitor identifier:
? const visitorId = result.visitorId
? // 寫入localStorage
? browserId = visitorId
? getbrowserId(browserId)
? console.log("visitorId ? "+visitorId)
? })
? .catch(error =>console.error(error))
? function getbrowserId( browserId ){
? if(!window.localStorage){
? swal("當(dāng)前瀏覽器版本比較低,請(qǐng)更換瀏覽器使用");
? }else{
? let storage=window.localStorage;
? if(storage.browserId != null){
? browserId = storage.browserId;
? }else{
? storage.browserId = browserId;
? }
? }
? }
在使用的時(shí)候呢發(fā)現(xiàn),首次打開網(wǎng)頁,和打開之后刷新一下后獲得的id是不一樣的。但是下一次清除掉緩存,再次打開和首次打開的id是一致的,刷新后和刷新后是一致的。
我有時(shí)候會(huì)獲取不到,雖然幾率非常小?。ㄏ旅媸请S機(jī)生成16位數(shù)字和字母組合的方法)
function getRamNumber(){
? var result='';
? for(var i=0;i<16;i++){
result+=Math.floor(Math.random()*16).toString(16)
? }
? return result;
? }
你是否還在尋找穩(wěn)定的海外服務(wù)器提供商?創(chuàng)新互聯(lián)www.cdcxhl.cn海外機(jī)房具備T級(jí)流量清洗系統(tǒng)配攻擊溯源,準(zhǔn)確流量調(diào)度確保服務(wù)器高可用性,企業(yè)級(jí)服務(wù)器適合批量采購,新人活動(dòng)首月15元起,快前往官網(wǎng)查看詳情吧
網(wǎng)站欄目:瀏覽器唯一id?瀏覽器設(shè)備指紋,使用隨機(jī)生成16位字母數(shù)字組合數(shù)-創(chuàng)新互聯(lián)
鏈接分享:http://fisionsoft.com.cn/article/pphsi.html