mirror of https://github.com/jkjoy/sunpeiwen.git
13 lines
398 B
JavaScript
13 lines
398 B
JavaScript
var pad = require('./pad.js');
|
|
|
|
var env = typeof window === 'object' ? window : self;
|
|
var globalCount = Object.keys(env).length;
|
|
var mimeTypesLength = navigator.mimeTypes ? navigator.mimeTypes.length : 0;
|
|
var clientId = pad((mimeTypesLength +
|
|
navigator.userAgent.length).toString(36) +
|
|
globalCount.toString(36), 4);
|
|
|
|
module.exports = function fingerprint () {
|
|
return clientId;
|
|
};
|