fingerprintjs-rails 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
|
|
1
1
|
/*
|
2
|
-
* fingerprintJS 0.4.
|
2
|
+
* fingerprintJS 0.4.2 - Fast browser fingerprint library
|
3
3
|
* https://github.com/Valve/fingerprintjs
|
4
4
|
* Copyright (c) 2013 Valentin Vasilyev (iamvalentin@gmail.com)
|
5
5
|
* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
|
@@ -54,7 +54,7 @@
|
|
54
54
|
keys.push(navigator.language);
|
55
55
|
keys.push(screen.colorDepth);
|
56
56
|
keys.push(new Date().getTimezoneOffset());
|
57
|
-
keys.push(
|
57
|
+
keys.push(this.hasSessionStorage());
|
58
58
|
keys.push(this.hasLocalStorage());
|
59
59
|
keys.push(!!window.indexedDB);
|
60
60
|
keys.push(typeof(document.body.addBehavior));
|
@@ -152,6 +152,14 @@
|
|
152
152
|
return true; // SecurityError when referencing it means it exists
|
153
153
|
}
|
154
154
|
},
|
155
|
+
|
156
|
+
hasSessionStorage: function(){
|
157
|
+
try{
|
158
|
+
return !!scope.sessionStorage;
|
159
|
+
} catch(e) {
|
160
|
+
return true; // SecurityError when referencing it means it exists
|
161
|
+
}
|
162
|
+
},
|
155
163
|
|
156
164
|
isCanvasSupported: function(){
|
157
165
|
var elem = document.createElement('canvas');
|
@@ -176,5 +184,8 @@
|
|
176
184
|
}
|
177
185
|
};
|
178
186
|
|
187
|
+
if (typeof module === 'object' && typeof exports === 'object') {
|
188
|
+
module.exports = Fingerprint;
|
189
|
+
}
|
179
190
|
scope.Fingerprint = Fingerprint;
|
180
191
|
})(window);
|
@@ -1,7 +1 @@
|
|
1
|
-
|
2
|
-
* fingerprintJS 0.4 - Fast browser fingerprint library
|
3
|
-
* https://github.com/Valve/fingerprintjs
|
4
|
-
* Copyright (c) 2013 Valentin Vasilyev (iamvalentin@gmail.com)
|
5
|
-
* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
|
6
|
-
*/
|
7
|
-
!function(t){"use strict";var e=function(t){var e=Array.prototype.forEach,a=Array.prototype.map;this.each=function(t,a,n){if(null!==t)if(e&&t.forEach===e)t.forEach(a,n);else if(t.length===+t.length){for(var r=0,o=t.length;o>r;r++)if(a.call(n,t[r],r,t)==={})return}else for(var i in t)if(t.hasOwnProperty(i)&&a.call(n,t[i],i,t)==={})return},this.map=function(t,e,n){var r=[];return null==t?r:a&&t.map===a?t.map(e,n):(this.each(t,function(t,a,o){r[r.length]=e.call(n,t,a,o)}),r)},"object"==typeof t?(this.hasher=t.hasher,this.canvas=t.canvas):"function"==typeof t&&(this.hasher=t)};e.prototype={get:function(){var e=[];e.push(navigator.userAgent),e.push(navigator.language),e.push(screen.colorDepth),e.push((new Date).getTimezoneOffset()),e.push(!!t.sessionStorage),e.push(this.hasLocalStorage()),e.push(!!window.indexedDB),e.push(typeof document.body.addBehavior),e.push(typeof window.openDatabase),e.push(navigator.cpuClass),e.push(navigator.platform),e.push(navigator.doNotTrack);var a=this.map(navigator.plugins,function(t){var e=this.map(t,function(t){return[t.type,t.suffixes].join("~")}).join(",");return[t.name,t.description,e].join("::")},this).join(";");return e.push(a),this.canvas&&this.isCanvasSupported()&&e.push(this.getCanvasFingerprint()),this.hasher?this.hasher(e.join("###"),31):this.murmurhash3_32_gc(e.join("###"),31)},murmurhash3_32_gc:function(t,e){var a,n,r,o,i,s,h,c;for(a=3&t.length,n=t.length-a,r=e,i=3432918353,s=461845907,c=0;n>c;)h=255&t.charCodeAt(c)|(255&t.charCodeAt(++c))<<8|(255&t.charCodeAt(++c))<<16|(255&t.charCodeAt(++c))<<24,++c,h=4294967295&(65535&h)*i+((65535&(h>>>16)*i)<<16),h=h<<15|h>>>17,h=4294967295&(65535&h)*s+((65535&(h>>>16)*s)<<16),r^=h,r=r<<13|r>>>19,o=4294967295&5*(65535&r)+((65535&5*(r>>>16))<<16),r=(65535&o)+27492+((65535&(o>>>16)+58964)<<16);switch(h=0,a){case 3:h^=(255&t.charCodeAt(c+2))<<16;case 2:h^=(255&t.charCodeAt(c+1))<<8;case 1:h^=255&t.charCodeAt(c),h=4294967295&(65535&h)*i+((65535&(h>>>16)*i)<<16),h=h<<15|h>>>17,h=4294967295&(65535&h)*s+((65535&(h>>>16)*s)<<16),r^=h}return r^=t.length,r^=r>>>16,r=4294967295&2246822507*(65535&r)+((65535&2246822507*(r>>>16))<<16),r^=r>>>13,r=4294967295&3266489909*(65535&r)+((65535&3266489909*(r>>>16))<<16),r^=r>>>16,r>>>0},hasLocalStorage:function(){try{return!!t.localStorage}catch(e){return!0}},isCanvasSupported:function(){var t=document.createElement("canvas");return!(!t.getContext||!t.getContext("2d"))},getCanvasFingerprint:function(){var t=document.createElement("canvas"),e=t.getContext("2d"),a="valve.github.io";return e.textBaseline="top",e.font="14px 'Arial'",e.textBaseline="alphabetic",e.fillStyle="#f60",e.fillRect(125,1,62,20),e.fillStyle="#069",e.fillText(a,2,15),e.fillStyle="rgba(102, 204, 0, 0.7)",e.fillText(a,4,17),t.toDataURL()}},t.Fingerprint=e}(window);
|
1
|
+
!function(t){"use strict";var e=function(t){var e=Array.prototype.forEach,a=Array.prototype.map;this.each=function(t,a,n){if(null!==t)if(e&&t.forEach===e)t.forEach(a,n);else if(t.length===+t.length){for(var r=0,o=t.length;o>r;r++)if(a.call(n,t[r],r,t)==={})return}else for(var i in t)if(t.hasOwnProperty(i)&&a.call(n,t[i],i,t)==={})return},this.map=function(t,e,n){var r=[];return null==t?r:a&&t.map===a?t.map(e,n):(this.each(t,function(t,a,o){r[r.length]=e.call(n,t,a,o)}),r)},"object"==typeof t?(this.hasher=t.hasher,this.canvas=t.canvas):"function"==typeof t&&(this.hasher=t)};e.prototype={get:function(){var t=[];t.push(navigator.userAgent),t.push(navigator.language),t.push(screen.colorDepth),t.push((new Date).getTimezoneOffset()),t.push(this.hasSessionStorage()),t.push(this.hasLocalStorage()),t.push(!!window.indexedDB),t.push(typeof document.body.addBehavior),t.push(typeof window.openDatabase),t.push(navigator.cpuClass),t.push(navigator.platform),t.push(navigator.doNotTrack);var e=this.map(navigator.plugins,function(t){var e=this.map(t,function(t){return[t.type,t.suffixes].join("~")}).join(",");return[t.name,t.description,e].join("::")},this).join(";");return t.push(e),this.canvas&&this.isCanvasSupported()&&t.push(this.getCanvasFingerprint()),this.hasher?this.hasher(t.join("###"),31):this.murmurhash3_32_gc(t.join("###"),31)},murmurhash3_32_gc:function(t,e){var a,n,r,o,i,s,h,c;for(a=3&t.length,n=t.length-a,r=e,i=3432918353,s=461845907,c=0;n>c;)h=255&t.charCodeAt(c)|(255&t.charCodeAt(++c))<<8|(255&t.charCodeAt(++c))<<16|(255&t.charCodeAt(++c))<<24,++c,h=4294967295&(65535&h)*i+((65535&(h>>>16)*i)<<16),h=h<<15|h>>>17,h=4294967295&(65535&h)*s+((65535&(h>>>16)*s)<<16),r^=h,r=r<<13|r>>>19,o=4294967295&5*(65535&r)+((65535&5*(r>>>16))<<16),r=(65535&o)+27492+((65535&(o>>>16)+58964)<<16);switch(h=0,a){case 3:h^=(255&t.charCodeAt(c+2))<<16;case 2:h^=(255&t.charCodeAt(c+1))<<8;case 1:h^=255&t.charCodeAt(c),h=4294967295&(65535&h)*i+((65535&(h>>>16)*i)<<16),h=h<<15|h>>>17,h=4294967295&(65535&h)*s+((65535&(h>>>16)*s)<<16),r^=h}return r^=t.length,r^=r>>>16,r=4294967295&2246822507*(65535&r)+((65535&2246822507*(r>>>16))<<16),r^=r>>>13,r=4294967295&3266489909*(65535&r)+((65535&3266489909*(r>>>16))<<16),r^=r>>>16,r>>>0},hasLocalStorage:function(){try{return!!t.localStorage}catch(e){return!0}},hasSessionStorage:function(){try{return!!t.sessionStorage}catch(e){return!0}},isCanvasSupported:function(){var t=document.createElement("canvas");return!(!t.getContext||!t.getContext("2d"))},getCanvasFingerprint:function(){var t=document.createElement("canvas"),e=t.getContext("2d"),a="http://valve.github.io";return e.textBaseline="top",e.font="14px 'Arial'",e.textBaseline="alphabetic",e.fillStyle="#f60",e.fillRect(125,1,62,20),e.fillStyle="#069",e.fillText(a,2,15),e.fillStyle="rgba(102, 204, 0, 0.7)",e.fillText(a,4,17),t.toDataURL()}},"object"==typeof module&&"object"==typeof exports&&(module.exports=e),t.Fingerprint=e}(window);
|
data/fingerprintjs-rails.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |gem|
|
6
6
|
gem.name = "fingerprintjs-rails"
|
7
|
-
gem.version = "0.4.
|
7
|
+
gem.version = "0.4.2"
|
8
8
|
gem.authors = ["Valentin Vasilyev"]
|
9
9
|
gem.email = ["iamvalentin@gmail.com"]
|
10
10
|
gem.description = "fingerprintjs for rails asset pipeline"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fingerprintjs-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-09-
|
12
|
+
date: 2013-09-27 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: fingerprintjs for rails asset pipeline
|
15
15
|
email:
|