browser-fingerprint
Advanced tools
Comparing version 0.0.1 to 0.1.0
@@ -7,6 +7,6 @@ 'use strict'; | ||
var pad = function pad(str, size) { | ||
return ('000000000' + str).slice(-size); | ||
return (new Array(size + 1).join('0') + str).slice(-size); | ||
}; | ||
var count = (function () { | ||
var globalCount = (function () { | ||
var count = 0; | ||
@@ -22,8 +22,8 @@ var window = window || global; | ||
var globalCount = function globalCount() { | ||
return count; | ||
}; | ||
var navi = navigator.mimeTypes.length + navigator.userAgent.length; | ||
var fingerprint = pad(navi.toString(36) + globalCount.toString(36), 4); | ||
exports['default'] = function () { | ||
return pad((navigator.mimeTypes.length + navigator.userAgent.length).toString(36) + globalCount().toString(36), 4); | ||
return fingerprint; | ||
}; | ||
@@ -30,0 +30,0 @@ |
18
index.js
'use strict' | ||
let pad = (str, size) => ('000000000' + str).slice(-size) | ||
const pad = (str, size) => (new Array(size + 1).join('0') + str).slice(-size) | ||
let count = (() => { | ||
const globalCount = (() => { | ||
let count = 0 | ||
let window = window || global | ||
const window = window || global | ||
@@ -13,11 +13,9 @@ for (let i in window) { | ||
return count; | ||
return count | ||
}()) | ||
let globalCount = () => count | ||
const navi = navigator.mimeTypes.length + navigator.userAgent.length | ||
export default () => pad( | ||
(navigator.mimeTypes.length + navigator.userAgent.length).toString(36) + | ||
globalCount().toString(36), | ||
4 | ||
) | ||
const fingerprint = pad(navi.toString(36) + globalCount.toString(36), 4) | ||
export default () => fingerprint |
{ | ||
"name": "browser-fingerprint", | ||
"version": "0.0.1", | ||
"version": "0.1.0", | ||
"description": "Generate a fingerprint of a browser", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
'use strict' | ||
var collision = false; | ||
var collision = false; | ||
import fingerprint from './index.js' | ||
import fingerprint from './dist/index.js' | ||
@@ -7,0 +7,0 @@ let test = require('tape') |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2590
50