fingerprintjs-rails 0.5.3 → 0.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE.txt +1 -1
- data/app/assets/javascripts/fingerprint.js +44 -18
- data/app/assets/javascripts/fingerprint.min.js +2 -2
- data/fingerprintjs-rails.gemspec +2 -2
- metadata +9 -11
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 823aeb05b2707f03cbedcbe93dfb385168c16c41
|
4
|
+
data.tar.gz: bb7adc71a9c7377308aa90d3218252f700a31dd3
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6ac6a2a552eb3f0646d84e48a676edd83979ef5025b97d80bc4890b9d03549f9f6d78ff81cfec276734c0c8f3f1df56ea0aeed5796fdc18799d55cdd13a205c4
|
7
|
+
data.tar.gz: 4412300c1ddd0ffa78057b81ce2890faed90323ed4556cb45dc91824a8e160a593f5d41b8f8e04871681b22e7bc7b30b51ea8ff1f14a43b7a1be5bd0c21dc679
|
data/LICENSE.txt
CHANGED
@@ -1,8 +1,19 @@
|
|
1
1
|
/*
|
2
|
-
* fingerprintJS 0.5.
|
2
|
+
* fingerprintJS 0.5.5 - Fast browser fingerprint library
|
3
3
|
* https://github.com/Valve/fingerprintjs
|
4
4
|
* Copyright (c) 2013 Valentin Vasilyev (valentin.vasilyev@outlook.com)
|
5
5
|
* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
|
6
|
+
*
|
7
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
8
|
+
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
9
|
+
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
10
|
+
* ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
11
|
+
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
12
|
+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
13
|
+
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
14
|
+
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
15
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
16
|
+
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
6
17
|
*/
|
7
18
|
|
8
19
|
;(function (name, context, definition) {
|
@@ -11,7 +22,7 @@
|
|
11
22
|
else { context[name] = definition(); }
|
12
23
|
})('Fingerprint', this, function () {
|
13
24
|
'use strict';
|
14
|
-
|
25
|
+
|
15
26
|
var Fingerprint = function (options) {
|
16
27
|
var nativeForEach, nativeMap;
|
17
28
|
nativeForEach = Array.prototype.forEach;
|
@@ -51,6 +62,7 @@
|
|
51
62
|
if (typeof options == 'object'){
|
52
63
|
this.hasher = options.hasher;
|
53
64
|
this.screen_resolution = options.screen_resolution;
|
65
|
+
this.screen_orientation = options.screen_orientation;
|
54
66
|
this.canvas = options.canvas;
|
55
67
|
this.ie_activex = options.ie_activex;
|
56
68
|
} else if(typeof options == 'function'){
|
@@ -67,13 +79,13 @@
|
|
67
79
|
if (this.screen_resolution) {
|
68
80
|
var resolution = this.getScreenResolution();
|
69
81
|
if (typeof resolution !== 'undefined'){ // headless browsers, such as phantomjs
|
70
|
-
keys.push(
|
82
|
+
keys.push(resolution.join('x'));
|
71
83
|
}
|
72
84
|
}
|
73
85
|
keys.push(new Date().getTimezoneOffset());
|
74
86
|
keys.push(this.hasSessionStorage());
|
75
87
|
keys.push(this.hasLocalStorage());
|
76
|
-
keys.push(
|
88
|
+
keys.push(this.hasIndexDb());
|
77
89
|
//body might not be defined at this point or removed programmatically
|
78
90
|
if(document.body){
|
79
91
|
keys.push(typeof(document.body.addBehavior));
|
@@ -97,35 +109,35 @@
|
|
97
109
|
|
98
110
|
/**
|
99
111
|
* JS Implementation of MurmurHash3 (r136) (as of May 20, 2011)
|
100
|
-
*
|
112
|
+
*
|
101
113
|
* @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
|
102
114
|
* @see http://github.com/garycourt/murmurhash-js
|
103
115
|
* @author <a href="mailto:aappleby@gmail.com">Austin Appleby</a>
|
104
116
|
* @see http://sites.google.com/site/murmurhash/
|
105
|
-
*
|
117
|
+
*
|
106
118
|
* @param {string} key ASCII only
|
107
119
|
* @param {number} seed Positive integer only
|
108
|
-
* @return {number} 32-bit positive integer hash
|
120
|
+
* @return {number} 32-bit positive integer hash
|
109
121
|
*/
|
110
122
|
|
111
123
|
murmurhash3_32_gc: function(key, seed) {
|
112
124
|
var remainder, bytes, h1, h1b, c1, c2, k1, i;
|
113
|
-
|
125
|
+
|
114
126
|
remainder = key.length & 3; // key.length % 4
|
115
127
|
bytes = key.length - remainder;
|
116
128
|
h1 = seed;
|
117
129
|
c1 = 0xcc9e2d51;
|
118
130
|
c2 = 0x1b873593;
|
119
131
|
i = 0;
|
120
|
-
|
132
|
+
|
121
133
|
while (i < bytes) {
|
122
|
-
k1 =
|
134
|
+
k1 =
|
123
135
|
((key.charCodeAt(i) & 0xff)) |
|
124
136
|
((key.charCodeAt(++i) & 0xff) << 8) |
|
125
137
|
((key.charCodeAt(++i) & 0xff) << 16) |
|
126
138
|
((key.charCodeAt(++i) & 0xff) << 24);
|
127
139
|
++i;
|
128
|
-
|
140
|
+
|
129
141
|
k1 = ((((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16))) & 0xffffffff;
|
130
142
|
k1 = (k1 << 15) | (k1 >>> 17);
|
131
143
|
k1 = ((((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16))) & 0xffffffff;
|
@@ -135,20 +147,20 @@
|
|
135
147
|
h1b = ((((h1 & 0xffff) * 5) + ((((h1 >>> 16) * 5) & 0xffff) << 16))) & 0xffffffff;
|
136
148
|
h1 = (((h1b & 0xffff) + 0x6b64) + ((((h1b >>> 16) + 0xe654) & 0xffff) << 16));
|
137
149
|
}
|
138
|
-
|
150
|
+
|
139
151
|
k1 = 0;
|
140
|
-
|
152
|
+
|
141
153
|
switch (remainder) {
|
142
154
|
case 3: k1 ^= (key.charCodeAt(i + 2) & 0xff) << 16;
|
143
155
|
case 2: k1 ^= (key.charCodeAt(i + 1) & 0xff) << 8;
|
144
156
|
case 1: k1 ^= (key.charCodeAt(i) & 0xff);
|
145
|
-
|
157
|
+
|
146
158
|
k1 = (((k1 & 0xffff) * c1) + ((((k1 >>> 16) * c1) & 0xffff) << 16)) & 0xffffffff;
|
147
159
|
k1 = (k1 << 15) | (k1 >>> 17);
|
148
160
|
k1 = (((k1 & 0xffff) * c2) + ((((k1 >>> 16) * c2) & 0xffff) << 16)) & 0xffffffff;
|
149
161
|
h1 ^= k1;
|
150
162
|
}
|
151
|
-
|
163
|
+
|
152
164
|
h1 ^= key.length;
|
153
165
|
|
154
166
|
h1 ^= h1 >>> 16;
|
@@ -168,7 +180,7 @@
|
|
168
180
|
return true; // SecurityError when referencing it means it exists
|
169
181
|
}
|
170
182
|
},
|
171
|
-
|
183
|
+
|
172
184
|
hasSessionStorage: function () {
|
173
185
|
try{
|
174
186
|
return !!window.sessionStorage;
|
@@ -177,6 +189,14 @@
|
|
177
189
|
}
|
178
190
|
},
|
179
191
|
|
192
|
+
hasIndexDb: function () {
|
193
|
+
try{
|
194
|
+
return !!window.indexedDB;
|
195
|
+
} catch(e) {
|
196
|
+
return true; // SecurityError when referencing it means it exists
|
197
|
+
}
|
198
|
+
},
|
199
|
+
|
180
200
|
isCanvasSupported: function () {
|
181
201
|
var elem = document.createElement('canvas');
|
182
202
|
return !!(elem.getContext && elem.getContext('2d'));
|
@@ -224,7 +244,7 @@
|
|
224
244
|
'WMPlayer.OCX', // Windows media player
|
225
245
|
'AgControl.AgControl', // Silverlight
|
226
246
|
'Skype.Detection'];
|
227
|
-
|
247
|
+
|
228
248
|
// starting to detect plugins in IE
|
229
249
|
return this.map(names, function(name){
|
230
250
|
try{
|
@@ -240,7 +260,13 @@
|
|
240
260
|
},
|
241
261
|
|
242
262
|
getScreenResolution: function () {
|
243
|
-
|
263
|
+
var resolution;
|
264
|
+
if(this.screen_orientation){
|
265
|
+
resolution = (screen.height > screen.width) ? [screen.height, screen.width] : [screen.width, screen.height];
|
266
|
+
}else{
|
267
|
+
resolution = [screen.height, screen.width];
|
268
|
+
}
|
269
|
+
return resolution;
|
244
270
|
},
|
245
271
|
|
246
272
|
getCanvasFingerprint: function () {
|
@@ -1,2 +1,2 @@
|
|
1
|
-
|
2
|
-
!function(
|
1
|
+
/* fingerprintjs 0.5.5 */
|
2
|
+
!function(t,e,n){"undefined"!=typeof module&&module.exports?module.exports=n():"function"==typeof define&&define.amd?define(n):e[t]=n()}("Fingerprint",this,function(){"use strict";var t=function(t){var e,n;e=Array.prototype.forEach,n=Array.prototype.map,this.each=function(t,n,r){if(null!==t)if(e&&t.forEach===e)t.forEach(n,r);else if(t.length===+t.length){for(var i=0,a=t.length;a>i;i++)if(n.call(r,t[i],i,t)==={})return}else for(var o in t)if(t.hasOwnProperty(o)&&n.call(r,t[o],o,t)==={})return},this.map=function(t,e,r){var i=[];return null==t?i:n&&t.map===n?t.map(e,r):(this.each(t,function(t,n,a){i[i.length]=e.call(r,t,n,a)}),i)},"object"==typeof t?(this.hasher=t.hasher,this.screen_resolution=t.screen_resolution,this.screen_orientation=t.screen_orientation,this.canvas=t.canvas,this.ie_activex=t.ie_activex):"function"==typeof t&&(this.hasher=t)};return t.prototype={get:function(){var t=[];if(t.push(navigator.userAgent),t.push(navigator.language),t.push(screen.colorDepth),this.screen_resolution){var e=this.getScreenResolution();void 0!==e&&t.push(e.join("x"))}return t.push((new Date).getTimezoneOffset()),t.push(this.hasSessionStorage()),t.push(this.hasLocalStorage()),t.push(this.hasIndexDb()),t.push(document.body?typeof document.body.addBehavior:"undefined"),t.push(typeof window.openDatabase),t.push(navigator.cpuClass),t.push(navigator.platform),t.push(navigator.doNotTrack),t.push(this.getPluginsString()),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 n,r,i,a,o,s,h,c;for(n=3&t.length,r=t.length-n,i=e,o=3432918353,s=461845907,c=0;r>c;)h=255&t.charCodeAt(c)|(255&t.charCodeAt(++c))<<8|(255&t.charCodeAt(++c))<<16|(255&t.charCodeAt(++c))<<24,++c,h=(65535&h)*o+(((h>>>16)*o&65535)<<16)&4294967295,h=h<<15|h>>>17,h=(65535&h)*s+(((h>>>16)*s&65535)<<16)&4294967295,i^=h,i=i<<13|i>>>19,a=5*(65535&i)+((5*(i>>>16)&65535)<<16)&4294967295,i=(65535&a)+27492+(((a>>>16)+58964&65535)<<16);switch(h=0,n){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=(65535&h)*o+(((h>>>16)*o&65535)<<16)&4294967295,h=h<<15|h>>>17,h=(65535&h)*s+(((h>>>16)*s&65535)<<16)&4294967295,i^=h}return i^=t.length,i^=i>>>16,i=2246822507*(65535&i)+((2246822507*(i>>>16)&65535)<<16)&4294967295,i^=i>>>13,i=3266489909*(65535&i)+((3266489909*(i>>>16)&65535)<<16)&4294967295,i^=i>>>16,i>>>0},hasLocalStorage:function(){try{return!!window.localStorage}catch(t){return!0}},hasSessionStorage:function(){try{return!!window.sessionStorage}catch(t){return!0}},hasIndexDb:function(){try{return!!window.indexedDB}catch(t){return!0}},isCanvasSupported:function(){var t=document.createElement("canvas");return!(!t.getContext||!t.getContext("2d"))},isIE:function(){return"Microsoft Internet Explorer"===navigator.appName?!0:"Netscape"===navigator.appName&&/Trident/.test(navigator.userAgent)?!0:!1},getPluginsString:function(){return this.isIE()&&this.ie_activex?this.getIEPluginsString():this.getRegularPluginsString()},getRegularPluginsString:function(){return 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(";")},getIEPluginsString:function(){if(window.ActiveXObject){var t=["ShockwaveFlash.ShockwaveFlash","AcroPDF.PDF","PDF.PdfCtrl","QuickTime.QuickTime","rmocx.RealPlayer G2 Control","rmocx.RealPlayer G2 Control.1","RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)","RealVideo.RealVideo(tm) ActiveX Control (32-bit)","RealPlayer","SWCtl.SWCtl","WMPlayer.OCX","AgControl.AgControl","Skype.Detection"];return this.map(t,function(t){try{return new ActiveXObject(t),t}catch(e){return null}}).join(";")}return""},getScreenResolution:function(){var t;return t=this.screen_orientation?screen.height>screen.width?[screen.height,screen.width]:[screen.width,screen.height]:[screen.height,screen.width]},getCanvasFingerprint:function(){var t=document.createElement("canvas"),e=t.getContext("2d"),n="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(n,2,15),e.fillStyle="rgba(102, 204, 0, 0.7)",e.fillText(n,4,17),t.toDataURL()}},t});
|
data/fingerprintjs-rails.gemspec
CHANGED
@@ -4,11 +4,11 @@ $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.5.
|
7
|
+
gem.version = "0.5.5"
|
8
8
|
gem.authors = ["Valentin Vasilyev"]
|
9
9
|
gem.email = ["valentin.vasilyev@outlook.com"]
|
10
10
|
gem.description = "fingerprintjs for rails asset pipeline"
|
11
|
-
gem.summary = "FingerprintJS JavaScript library, packaged for Ruby
|
11
|
+
gem.summary = "FingerprintJS JavaScript library, packaged for Ruby on Rails asset pipeline"
|
12
12
|
gem.homepage = "http://valve.github.com/fingerprintjs"
|
13
13
|
|
14
14
|
gem.files = `git ls-files`.split($/)
|
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fingerprintjs-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
5
|
-
prerelease:
|
4
|
+
version: 0.5.5
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Valentin Vasilyev
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2017-07-26 00:00:00.000000000 Z
|
13
12
|
dependencies: []
|
14
13
|
description: fingerprintjs for rails asset pipeline
|
15
14
|
email:
|
@@ -18,7 +17,7 @@ executables: []
|
|
18
17
|
extensions: []
|
19
18
|
extra_rdoc_files: []
|
20
19
|
files:
|
21
|
-
- .gitignore
|
20
|
+
- ".gitignore"
|
22
21
|
- Gemfile
|
23
22
|
- LICENSE.txt
|
24
23
|
- README.md
|
@@ -29,26 +28,25 @@ files:
|
|
29
28
|
- lib/fingerprintjs-rails.rb
|
30
29
|
homepage: http://valve.github.com/fingerprintjs
|
31
30
|
licenses: []
|
31
|
+
metadata: {}
|
32
32
|
post_install_message:
|
33
33
|
rdoc_options: []
|
34
34
|
require_paths:
|
35
35
|
- lib
|
36
36
|
required_ruby_version: !ruby/object:Gem::Requirement
|
37
|
-
none: false
|
38
37
|
requirements:
|
39
|
-
- -
|
38
|
+
- - ">="
|
40
39
|
- !ruby/object:Gem::Version
|
41
40
|
version: '0'
|
42
41
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
43
|
-
none: false
|
44
42
|
requirements:
|
45
|
-
- -
|
43
|
+
- - ">="
|
46
44
|
- !ruby/object:Gem::Version
|
47
45
|
version: '0'
|
48
46
|
requirements: []
|
49
47
|
rubyforge_project:
|
50
|
-
rubygems_version:
|
48
|
+
rubygems_version: 2.6.11
|
51
49
|
signing_key:
|
52
|
-
specification_version:
|
53
|
-
summary: FingerprintJS JavaScript library, packaged for Ruby
|
50
|
+
specification_version: 4
|
51
|
+
summary: FingerprintJS JavaScript library, packaged for Ruby on Rails asset pipeline
|
54
52
|
test_files: []
|