fingerprintjs-rails 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,14 +1,14 @@
|
|
1
1
|
/*
|
2
|
-
* fingerprintJS 0.
|
2
|
+
* fingerprintJS 0.3 - 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.
|
6
6
|
*/
|
7
7
|
/*jslint browser: true, indent: 2 */
|
8
|
-
(function() {
|
8
|
+
(function(scope) {
|
9
9
|
'use strict';
|
10
10
|
|
11
|
-
|
11
|
+
var Fingerprint = function(hasher){
|
12
12
|
var nativeForEach = Array.prototype.forEach;
|
13
13
|
var nativeMap = Array.prototype.map;
|
14
14
|
this.each = function(obj, iterator, context) {
|
@@ -47,7 +47,8 @@
|
|
47
47
|
get: function(){
|
48
48
|
var keys = [];
|
49
49
|
keys.push(navigator.userAgent);
|
50
|
-
keys.push(
|
50
|
+
keys.push(navigator.language);
|
51
|
+
keys.push(screen.colorDepth);
|
51
52
|
keys.push(new Date().getTimezoneOffset());
|
52
53
|
keys.push(!!window.sessionStorage);
|
53
54
|
keys.push(!!window.localStorage);
|
@@ -130,4 +131,6 @@
|
|
130
131
|
return h1 >>> 0;
|
131
132
|
}
|
132
133
|
}
|
133
|
-
|
134
|
+
|
135
|
+
scope.Fingerprint = Fingerprint;
|
136
|
+
})(window);
|
@@ -1,10 +1 @@
|
|
1
|
-
|
2
|
-
* fingerprintJS 0.2 - 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(){'use strict';window.Fingerprint=function(a){var e=Array.prototype.forEach,f=Array.prototype.map;this.each=function(a,b,c){if(null!==a)if(e&&a.forEach===e)a.forEach(b,c);else if(a.length===+a.length)for(var d=0,f=a.length;d<f&&b.call(c,a[d],d,a)!=={};d++);else for(d in a)if(a.hasOwnProperty(d)&&b.call(c,a[d],d,a)==={})break};this.map=function(a,b,c){var d=[];if(null==a)return d;if(f&&a.map===f)return a.map(b,c);this.each(a,function(a,f,e){d[d.length]=b.call(c,a,f,e)});return d};a&&(this.hasher=a)};
|
8
|
-
Fingerprint.prototype={get:function(){var a=[];a.push(navigator.userAgent);a.push([screen.height,screen.width,screen.colorDepth].join("x"));a.push((new Date).getTimezoneOffset());a.push(!!window.sessionStorage);a.push(!!window.localStorage);var e=this.map(navigator.plugins,function(a){var e=this.map(a,function(a){return[a.type,a.suffixes].join("~")}).join(",");return[a.name,a.description,e].join("::")},this).join(";");a.push(e);return this.hasher?this.hasher(a.join("###"),31):this.murmurhash3_32_gc(a.join("###"),
|
9
|
-
31)},murmurhash3_32_gc:function(a,e){var f,g,b,c,d;f=a.length&3;g=a.length-f;b=e;for(d=0;d<g;)c=a.charCodeAt(d)&255|(a.charCodeAt(++d)&255)<<8|(a.charCodeAt(++d)&255)<<16|(a.charCodeAt(++d)&255)<<24,++d,c=3432918353*(c&65535)+((3432918353*(c>>>16)&65535)<<16)&4294967295,c=c<<15|c>>>17,c=461845907*(c&65535)+((461845907*(c>>>16)&65535)<<16)&4294967295,b^=c,b=b<<13|b>>>19,b=5*(b&65535)+((5*(b>>>16)&65535)<<16)&4294967295,b=(b&65535)+27492+(((b>>>16)+58964&65535)<<16);c=0;switch(f){case 3:c^=(a.charCodeAt(d+
|
10
|
-
2)&255)<<16;case 2:c^=(a.charCodeAt(d+1)&255)<<8;case 1:c^=a.charCodeAt(d)&255,c=3432918353*(c&65535)+((3432918353*(c>>>16)&65535)<<16)&4294967295,c=c<<15|c>>>17,b^=461845907*(c&65535)+((461845907*(c>>>16)&65535)<<16)&4294967295}b^=a.length;b^=b>>>16;b=2246822507*(b&65535)+((2246822507*(b>>>16)&65535)<<16)&4294967295;b^=b>>>13;b=3266489909*(b&65535)+((3266489909*(b>>>16)&65535)<<16)&4294967295;return(b^b>>>16)>>>0}}})();
|
1
|
+
!function(r){"use strict";var t=function(r){var t=Array.prototype.forEach,e=Array.prototype.map;this.each=function(r,e,n){if(null!==r)if(t&&r.forEach===t)r.forEach(e,n);else if(r.length===+r.length){for(var a=0,h=r.length;h>a;a++)if(e.call(n,r[a],a,r)==={})return}else for(var o in r)if(r.hasOwnProperty(o)&&e.call(n,r[o],o,r)==={})return},this.map=function(r,t,n){var a=[];return null==r?a:e&&r.map===e?r.map(t,n):(this.each(r,function(r,e,h){a[a.length]=t.call(n,r,e,h)}),a)},r&&(this.hasher=r)};t.prototype={get:function(){var r=[];r.push(navigator.userAgent),r.push(navigator.language),r.push(screen.colorDepth),r.push((new Date).getTimezoneOffset()),r.push(!!window.sessionStorage),r.push(!!window.localStorage);var t=this.map(navigator.plugins,function(r){var t=this.map(r,function(r){return[r.type,r.suffixes].join("~")}).join(",");return[r.name,r.description,t].join("::")},this).join(";");return r.push(t),this.hasher?this.hasher(r.join("###"),31):this.murmurhash3_32_gc(r.join("###"),31)},murmurhash3_32_gc:function(r,t){var e,n,a,h,o,i,s,c;for(e=3&r.length,n=r.length-e,a=t,o=3432918353,i=461845907,c=0;n>c;)s=255&r.charCodeAt(c)|(255&r.charCodeAt(++c))<<8|(255&r.charCodeAt(++c))<<16|(255&r.charCodeAt(++c))<<24,++c,s=4294967295&(65535&s)*o+((65535&(s>>>16)*o)<<16),s=s<<15|s>>>17,s=4294967295&(65535&s)*i+((65535&(s>>>16)*i)<<16),a^=s,a=a<<13|a>>>19,h=4294967295&5*(65535&a)+((65535&5*(a>>>16))<<16),a=(65535&h)+27492+((65535&(h>>>16)+58964)<<16);switch(s=0,e){case 3:s^=(255&r.charCodeAt(c+2))<<16;case 2:s^=(255&r.charCodeAt(c+1))<<8;case 1:s^=255&r.charCodeAt(c),s=4294967295&(65535&s)*o+((65535&(s>>>16)*o)<<16),s=s<<15|s>>>17,s=4294967295&(65535&s)*i+((65535&(s>>>16)*i)<<16),a^=s}return a^=r.length,a^=a>>>16,a=4294967295&2246822507*(65535&a)+((65535&2246822507*(a>>>16))<<16),a^=a>>>13,a=4294967295&3266489909*(65535&a)+((65535&3266489909*(a>>>16))<<16),a^=a>>>16,a>>>0}},r.Fingerprint=t}(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.
|
7
|
+
gem.version = "0.3.0"
|
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
|
+
version: 0.3.0
|
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-
|
12
|
+
date: 2013-06-04 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: fingerprintjs for rails asset pipeline
|
15
15
|
email:
|