Advertisement
Guest User

AreYouAHuman fingerprinting script

a guest
Jun 24th, 2015
608
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ! function(e, t, n) {
  2.     "undefined" != typeof module && module.exports ? module.exports = n() : "function" == typeof define && define.amd ? define(n) : t[e] = n()
  3. }("Fingerprint", this, function() {
  4.     "use strict";
  5.     var e = function(e) {
  6.         var t, n;
  7.         t = Array.prototype.forEach, n = Array.prototype.map, this.each = function(e, n, r) {
  8.             if (null !== e)
  9.                 if (t && e.forEach === t) e.forEach(n, r);
  10.                 else if (e.length === +e.length) {
  11.                 for (var i = 0, a = e.length; a > i; i++)
  12.                     if (n.call(r, e[i], i, e) === {}) return
  13.             } else
  14.                 for (var o in e)
  15.                     if (e.hasOwnProperty(o) && n.call(r, e[o], o, e) === {}) return
  16.         }, this.map = function(e, t, r) {
  17.             var i = [];
  18.             return null == e ? i : n && e.map === n ? e.map(t, r) : (this.each(e, function(e, n, a) {
  19.                 i[i.length] = t.call(r, e, n, a)
  20.             }), i)
  21.         }, "object" == typeof e ? (this.hasher = e.hasher, this.screen_resolution = e.screen_resolution, this.screen_orientation = e.screen_orientation, this.canvas = e.canvas, this.ie_activex = e.ie_activex) : "function" == typeof e && (this.hasher = e)
  22.     };
  23.     return e.prototype = {
  24.         get: function() {
  25.             var e = [];
  26.             if (e.push(navigator.userAgent), e.push(navigator.language), e.push(screen.colorDepth), this.screen_resolution) {
  27.                 var t = this.getScreenResolution();
  28.                 "undefined" != typeof t && e.push(this.getScreenResolution().join("x"))
  29.             }
  30.             return e.push((new Date).getTimezoneOffset()), e.push(this.hasSessionStorage()), e.push(this.hasLocalStorage()), e.push(!!window.indexedDB), e.push(document.body ? typeof document.body.addBehavior : "undefined"), e.push(typeof window.openDatabase), e.push(navigator.cpuClass), e.push(navigator.platform), e.push(navigator.doNotTrack), e.push(this.getPluginsString()), this.canvas && this.isCanvasSupported() && e.push(this.getCanvasFingerprint()), this.hasher ? this.hasher(e.join("###"), 31) : this.murmurhash3_32_gc(e.join("###"), 31)
  31.         },
  32.         murmurhash3_32_gc: function(e, t) {
  33.             var n, r, i, a, o, s, c, u;
  34.             for (n = 3 & e.length, r = e.length - n, i = t, o = 3432918353, s = 461845907, u = 0; r > u;) c = 255 & e.charCodeAt(u) | (255 & e.charCodeAt(++u)) << 8 | (255 & e.charCodeAt(++u)) << 16 | (255 & e.charCodeAt(++u)) << 24, ++u, c = (65535 & c) * o + (((c >>> 16) * o & 65535) << 16) & 4294967295, c = c << 15 | c >>> 17, c = (65535 & c) * s + (((c >>> 16) * s & 65535) << 16) & 4294967295, i ^= c, i = i << 13 | i >>> 19, a = 5 * (65535 & i) + ((5 * (i >>> 16) & 65535) << 16) & 4294967295, i = (65535 & a) + 27492 + (((a >>> 16) + 58964 & 65535) << 16);
  35.             switch (c = 0, n) {
  36.                 case 3:
  37.                     c ^= (255 & e.charCodeAt(u + 2)) << 16;
  38.                 case 2:
  39.                     c ^= (255 & e.charCodeAt(u + 1)) << 8;
  40.                 case 1:
  41.                     c ^= 255 & e.charCodeAt(u), c = (65535 & c) * o + (((c >>> 16) * o & 65535) << 16) & 4294967295, c = c << 15 | c >>> 17, c = (65535 & c) * s + (((c >>> 16) * s & 65535) << 16) & 4294967295, i ^= c
  42.             }
  43.             return i ^= e.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
  44.         },
  45.         hasLocalStorage: function() {
  46.             try {
  47.                 return !!window.localStorage
  48.             } catch (e) {
  49.                 return !0
  50.             }
  51.         },
  52.         hasSessionStorage: function() {
  53.             try {
  54.                 return !!window.sessionStorage
  55.             } catch (e) {
  56.                 return !0
  57.             }
  58.         },
  59.         isCanvasSupported: function() {
  60.             var e = document.createElement("canvas");
  61.             return !(!e.getContext || !e.getContext("2d"))
  62.         },
  63.         isIE: function() {
  64.             return "Microsoft Internet Explorer" === navigator.appName ? !0 : "Netscape" === navigator.appName && /Trident/.test(navigator.userAgent) ? !0 : !1
  65.         },
  66.         getPluginsString: function() {
  67.             return this.isIE() && this.ie_activex ? this.getIEPluginsString() : this.getRegularPluginsString()
  68.         },
  69.         getRegularPluginsString: function() {
  70.             return this.map(navigator.plugins, function(e) {
  71.                 var t = this.map(e, function(e) {
  72.                     return [e.type, e.suffixes].join("~")
  73.                 }).join(",");
  74.                 return [e.name, e.description, t].join("::")
  75.             }, this).join(";")
  76.         },
  77.         getIEPluginsString: function() {
  78.             if (window.ActiveXObject) {
  79.                 var e = ["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"];
  80.                 return this.map(e, function(e) {
  81.                     try {
  82.                         return new ActiveXObject(e), e
  83.                     } catch (t) {
  84.                         return null
  85.                     }
  86.                 }).join(";")
  87.             }
  88.             return ""
  89.         },
  90.         getScreenResolution: function() {
  91.             var e;
  92.             return e = this.screen_orientation ? screen.height > screen.width ? [screen.height, screen.width] : [screen.width, screen.height] : [screen.height, screen.width]
  93.         },
  94.         getCanvasFingerprint: function() {
  95.             var e = document.createElement("canvas"),
  96.                 t = e.getContext("2d"),
  97.                 n = "http://valve.github.io";
  98.             return t.textBaseline = "top", t.font = "14px 'Arial'", t.textBaseline = "alphabetic", t.fillStyle = "#f60", t.fillRect(125, 1, 62, 20), t.fillStyle = "#069", t.fillText(n, 2, 15), t.fillStyle = "rgba(102, 204, 0, 0.7)", t.fillText(n, 4, 17), e.toDataURL()
  99.         }
  100.     }, e
  101. });
  102. ayah_debug("starting cat");
  103. var protocol = window.location.protocol === "https:" ? "https:" : "http:";
  104. var AYAH_ATTEMPT_KEY = "";
  105. var ayah_debug_enabled = 0;
  106. var ayah_debug_verbose_enabled = 0;
  107. var scripts = document.getElementsByTagName("script");
  108. var script = scripts[scripts.length - 1];
  109. var scriptURL = script.src;
  110. var scriptParameters = {};
  111. var AYAH_kitten = document.createElement("iframe");
  112. if (scriptURL.indexOf("?") != -1) {
  113.     querystring = scriptURL.substring(scriptURL.indexOf("?") + 1).split("&");
  114.     var scriptParameters = {},
  115.         pair, d = decodeURIComponent;
  116.     for (var i = querystring.length - 1; i >= 0; i--) {
  117.         pair = querystring[i].split("=");
  118.         if (pair[0].indexOf("AYAH_") == 0) {
  119.             scriptParameters[d(pair[0])] = d(pair[1])
  120.         }
  121.     }
  122. }
  123. var inIframe = window.self !== window.top;
  124. var w = window,
  125.     d = document,
  126.     e = d.documentElement,
  127.     g = d.getElementsByTagName("body")[0],
  128.     x = w.innerWidth || e.clientWidth || g.clientWidth,
  129.     y = w.innerHeight || e.clientHeight || g.clientHeight;
  130. var screenSize = x + "x" + y;
  131. var device_screen_width = x;
  132. var device_screen_height = y;
  133.  
  134. function getFrameDepth(e) {
  135.     if (e === window.top) {
  136.         return 0
  137.     } else if (e.parent === window.top) {
  138.         return 1
  139.     }
  140.     return 1 + getFrameDepth(e.parent)
  141. }
  142. var iframe_depth = getFrameDepth(self);
  143.  
  144. function ayah_debug(e) {
  145.     if (!window.console) console = {
  146.         log: function() {}
  147.     };
  148.     if (ayah_debug_enabled) {
  149.         var t = new Date;
  150.         console.log(t.getTime() + " " + e);
  151.         var n = document.getElementById("ayah_debug_console");
  152.         if (n) {
  153.             n.innerHTML += "\n<br>" + e
  154.         }
  155.     }
  156. }
  157.  
  158. function ayah_debug_verbose(e) {
  159.     if (ayah_debug_verbose_enabled) {
  160.         ayah_debug(e)
  161.     }
  162. }
  163.  
  164. function create_litter() {
  165.     ayah_debug("creating a litter");
  166.     var e = new Fingerprint({
  167.         ie_activex: true,
  168.         canvas: true
  169.     }).get();
  170.     AYAH_kitten.id = "AYAH_iframe" + (new Date).getTime();
  171.     var t = "?iframe=" + inIframe + "&device_screen_width=" + device_screen_width + "&device_screen_height=" + device_screen_height + "&screenSize=" + screenSize + "&ak=" + AYAH_ATTEMPT_KEY + "&pk=" + "d7abbedbc3ac5970e1f94b0f6a884d92bf6a2303" + "&AYAH_VERSION=1.1" + "&AYAH_FINGERPRINT_VALVE=" + e + "&cookiesync=true" + "&pd=" + window.location.hostname + "&iframe_depth=" + iframe_depth + "&history_depth=" + window.history.length;
  172.     for (p in scriptParameters) {
  173.         t += "&" + p + "=" + scriptParameters[p]
  174.     }
  175.     AYAH_kitten.src = protocol + "//n-cdn.areyouahuman.com/kitten" + t;
  176.     AYAH_kitten.width = 0;
  177.     AYAH_kitten.height = 0;
  178.     AYAH_kitten.scrolling = "no";
  179.     AYAH_kitten.frameBorder = 0;
  180.     AYAH_kitten.style.cssText = "border:none;overflow:hidden;display:none;";
  181.     var n = document.getElementsByTagName("script")[0];
  182.     n.parentNode.insertBefore(AYAH_kitten, n)
  183. }(function() {
  184.     var e = new Date;
  185.     var t = e.getTime();
  186.     var n = AYAH_ATTEMPT_KEY = p();
  187.     var r = new Array;
  188.     var i = 0;
  189.     create_litter();
  190.     var o = t;
  191.  
  192.     function s(e) {
  193.         ++A[e.button];
  194.         ++S
  195.     }
  196.  
  197.     function c(e) {
  198.         --A[e.button];
  199.         --S
  200.     }
  201.  
  202.     function u(e) {
  203.         ayah_debug("handleBeforeUnload called");
  204.         h()
  205.     }
  206.  
  207.     function h() {
  208.         ayah_debug("ayahCleanup executing");
  209.         clearInterval(H);
  210.         clearInterval(T);
  211.         clearInterval(C);
  212.         _(document, "mousedown", s);
  213.         _(document, "mouseup", c);
  214.         _(document, "mousemove", f);
  215.         _(document, "touchmove", d);
  216.         _(document, "touchstart", d);
  217.         _(document, "touchend", d);
  218.         ayah_debug("send all remaining observations");
  219.         l(0);
  220.         ayah_debug("sent all remaining observations")
  221.     }
  222.  
  223.     function l(e) {
  224.         if (typeof e == "undefined") {
  225.             e = 100
  226.         }
  227.         ayah_debug("minObservationsToSend: " + e);
  228.         var a = new Array;
  229.         var s = o;
  230.         ayah_debug_verbose("in ayahSendObservations timeObservationLastSent: " + o);
  231.         for (var c = 0; c < r.length - 1; c++) {
  232.             ayah_debug("observations.length: " + r.length);
  233.             var u = r[c];
  234.             ayah_debug_verbose("looking at obs.time: " + u.time + ", timeObservationLastSent: " + o);
  235.             if (parseInt(u.time + t) > parseInt(o)) {
  236.                 ayah_debug_verbose("updating sendableObservations: " + u.time + ", timeObservationLastSent: " + o);
  237.                 a.push(u.x, u.y, u.mousebutton, u.time);
  238.                 s = u.time
  239.             }
  240.             if (a.length >= 1100) {
  241.                 ayah_debug("sendableObservations.length: " + a.length);
  242.                 ayah_debug("maximum observation length reached, time to send it");
  243.                 continue
  244.             }
  245.         }
  246.         ayah_debug_verbose("sendable observations.length: " + a.length);
  247.         if (a.length > e) {
  248.             var l = String(a);
  249.             ayah_debug_verbose("before resetting timeObservationLastSent: " + o);
  250.             o = s + t;
  251.             ayah_debug_verbose("after resetting timeObservationLastSent: " + o);
  252.             ayah_debug_verbose("would send these observations: " + l);
  253.             od = encodeURIComponent(v(l + "!" + n, n));
  254.             var d = protocol + "//n-cdn.areyouahuman.com/observe?" + "ak=" + n + "&pk=" + "d7abbedbc3ac5970e1f94b0f6a884d92bf6a2303" + "&AYAH_VERSION=1.1" + "&od=" + od;
  255.             y(d);
  256.             i += 1;
  257.             if (i >= 5) {
  258.                 h()
  259.             }
  260.             ayah_debug_verbose("sent the observation number: " + i)
  261.         }
  262.     }
  263.  
  264.     function d(e) {
  265.         f(e, true)
  266.     }
  267.  
  268.     function f(e, n) {
  269.         if (typeof n == "undefined") {
  270.             n = false
  271.         }
  272.         var r, i, a, o, s, c, u = -1;
  273.         e = e || window.event;
  274.         if (e.pageX == null && e.clientX != null) {
  275.             i = e.target && e.target.ownerDocument || document;
  276.             a = i.documentElement;
  277.             o = i.body;
  278.             e.pageX = e.clientX + (a && a.scrollLeft || o && o.scrollLeft || 0) - (a && a.clientLeft || o && o.clientLeft || 0);
  279.             e.pageY = e.clientY + (a && a.scrollTop || o && o.scrollTop || 0) - (a && a.clientTop || o && o.clientTop || 0)
  280.         }
  281.         var h = new Date;
  282.         var l = h.getTime() - t;
  283.         if (n) {
  284.             if (typeof e.touches != "undefined" && typeof e.touches[0] != "undefined" && typeof e.touches[0].pageX != "undefined" && typeof e.touches[0].pageY != "undefined") {
  285.                 b = {
  286.                     x: e.touches[0].pageX,
  287.                     y: e.touches[0].pageY,
  288.                     mousebutton: 1,
  289.                     time: l
  290.                 }
  291.             }
  292.         } else {
  293.             if (S) {
  294.                 for (var d = 0; d < A.length; ++d) {
  295.                     if (A[d]) {
  296.                         u = d;
  297.                         ayah_debug_verbose("mouse button pressed: " + d)
  298.                     }
  299.                 }
  300.             }
  301.             if (typeof e.pageX != "undefined" && typeof e.pageY != "undefined") {
  302.                 b = {
  303.                     x: e.pageX,
  304.                     y: e.pageY,
  305.                     mousebutton: u,
  306.                     time: l
  307.                 }
  308.             }
  309.         }
  310.     }
  311.  
  312.     function g() {
  313.         var e = b;
  314.         if (!e) {} else {
  315.             if (w && e.x == w.x && e.y == w.y) {} else {
  316.                 w = e;
  317.                 r.push(e)
  318.             }
  319.         }
  320.     }
  321.  
  322.     function p() {
  323.         var e = (new Date).getTime();
  324.         var t = "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxxx".replace(/[xy]/g, function(t) {
  325.             var n = (e + Math.random() * 16) % 16 | 0;
  326.             e = Math.floor(e / 16);
  327.             return (t == "x" ? n : n & 7 | 8).toString(16)
  328.         });
  329.         return t
  330.     }
  331.  
  332.     function v(e, t) {
  333.         ayah_debug("od to encode: " + e);
  334.         __hash = CryptoJS.SHA1(t).toString();
  335.         __ePointer = 0;
  336.         __chars = new Array;
  337.         for (var n = 0; n < __hash.length; n++) {
  338.             __chars.push(__hash.charCodeAt(n))
  339.         }
  340.         var r = new Array;
  341.         a = e;
  342.         for (var n = 0; n < a.length; n++) {
  343.             var i = a.charCodeAt(n);
  344.             var o = i + __chars[__ePointer];
  345.             while (o > 126) o -= 95;
  346.             r.push(String.fromCharCode(o));
  347.             __ePointer = (__ePointer + 1) % __chars.length
  348.         }
  349.         e = String(r.join(""));
  350.         ayah_debug("encoded str: " + e);
  351.         return e
  352.     }
  353.  
  354.     function m(e, t, n) {
  355.         ayah_debug("attaching an event obj: " + e + ", type: " + t);
  356.         if (e.attachEvent) {
  357.             e["e" + t + n] = n;
  358.             e[t + n] = function() {
  359.                 e["e" + t + n](window.event)
  360.             };
  361.             e.attachEvent("on" + t, e[t + n])
  362.         } else e.addEventListener(t, n, false)
  363.     }
  364.  
  365.     function _(e, t, n) {
  366.         if (e.detachEvent) {
  367.             e.detachEvent("on" + t, e[t + n]);
  368.             e[t + n] = null
  369.         } else e.removeEventListener(t, n, false)
  370.     }
  371.  
  372.     function y(e) {
  373.         if (window.XDomainRequest) {
  374.             var t = new XDomainRequest;
  375.             t.open("get", e);
  376.             t.onload = function() {};
  377.             t.send()
  378.         } else {
  379.             var t = Xhr();
  380.             t.open("get", e);
  381.             t.send()
  382.         }
  383.     }
  384.     var b;
  385.     var w;
  386.     var x = 1e3 / 50;
  387.     var A = [0, 0, 0, 0, 0, 0, 0, 0, 0],
  388.         S = 0;
  389.     m(document, "mousedown", s);
  390.     m(document, "mouseup", c);
  391.     m(document, "mousemove", f);
  392.     m(document, "touchmove", d);
  393.     m(document, "touchstart", d);
  394.     m(document, "touchend", d);
  395.     window.onbeforeunload = u;
  396.     var T = setInterval(g, x);
  397.     var C = setInterval(l, 2 * 1e3);
  398.     var H = setInterval(h, 300 * 1e3)
  399. })();
  400. var CryptoJS = CryptoJS || function(e, t) {
  401.     var n = {},
  402.         r = n.lib = {},
  403.         i = function() {},
  404.         a = r.Base = {
  405.             extend: function(e) {
  406.                 i.prototype = this;
  407.                 var t = new i;
  408.                 e && t.mixIn(e);
  409.                 t.hasOwnProperty("init") || (t.init = function() {
  410.                     t.$super.init.apply(this, arguments)
  411.                 });
  412.                 t.init.prototype = t;
  413.                 t.$super = this;
  414.                 return t
  415.             },
  416.             create: function() {
  417.                 var e = this.extend();
  418.                 e.init.apply(e, arguments);
  419.                 return e
  420.             },
  421.             init: function() {},
  422.             mixIn: function(e) {
  423.                 for (var t in e) e.hasOwnProperty(t) && (this[t] = e[t]);
  424.                 e.hasOwnProperty("toString") && (this.toString = e.toString)
  425.             },
  426.             clone: function() {
  427.                 return this.init.prototype.extend(this)
  428.             }
  429.         },
  430.         o = r.WordArray = a.extend({
  431.             init: function(e, n) {
  432.                 e = this.words = e || [];
  433.                 this.sigBytes = n != t ? n : 4 * e.length
  434.             },
  435.             toString: function(e) {
  436.                 return (e || c).stringify(this)
  437.             },
  438.             concat: function(e) {
  439.                 var t = this.words,
  440.                     n = e.words,
  441.                     r = this.sigBytes;
  442.                 e = e.sigBytes;
  443.                 this.clamp();
  444.                 if (r % 4)
  445.                     for (var i = 0; i < e; i++) t[r + i >>> 2] |= (n[i >>> 2] >>> 24 - 8 * (i % 4) & 255) << 24 - 8 * ((r + i) % 4);
  446.                 else if (65535 < n.length)
  447.                     for (i = 0; i < e; i += 4) t[r + i >>> 2] = n[i >>> 2];
  448.                 else t.push.apply(t, n);
  449.                 this.sigBytes += e;
  450.                 return this
  451.             },
  452.             clamp: function() {
  453.                 var t = this.words,
  454.                     n = this.sigBytes;
  455.                 t[n >>> 2] &= 4294967295 << 32 - 8 * (n % 4);
  456.                 t.length = e.ceil(n / 4)
  457.             },
  458.             clone: function() {
  459.                 var e = a.clone.call(this);
  460.                 e.words = this.words.slice(0);
  461.                 return e
  462.             },
  463.             random: function(t) {
  464.                 for (var n = [], r = 0; r < t; r += 4) n.push(4294967296 * e.random() | 0);
  465.                 return new o.init(n, t)
  466.             }
  467.         }),
  468.         s = n.enc = {},
  469.         c = s.Hex = {
  470.             stringify: function(e) {
  471.                 var t = e.words;
  472.                 e = e.sigBytes;
  473.                 for (var n = [], r = 0; r < e; r++) {
  474.                     var i = t[r >>> 2] >>> 24 - 8 * (r % 4) & 255;
  475.                     n.push((i >>> 4).toString(16));
  476.                     n.push((i & 15).toString(16))
  477.                 }
  478.                 return n.join("")
  479.             },
  480.             parse: function(e) {
  481.                 for (var t = e.length, n = [], r = 0; r < t; r += 2) n[r >>> 3] |= parseInt(e.substr(r, 2), 16) << 24 - 4 * (r % 8);
  482.                 return new o.init(n, t / 2)
  483.             }
  484.         },
  485.         u = s.Latin1 = {
  486.             stringify: function(e) {
  487.                 var t = e.words;
  488.                 e = e.sigBytes;
  489.                 for (var n = [], r = 0; r < e; r++) n.push(String.fromCharCode(t[r >>> 2] >>> 24 - 8 * (r % 4) & 255));
  490.                 return n.join("")
  491.             },
  492.             parse: function(e) {
  493.                 for (var t = e.length, n = [], r = 0; r < t; r++) n[r >>> 2] |= (e.charCodeAt(r) & 255) << 24 - 8 * (r % 4);
  494.                 return new o.init(n, t)
  495.             }
  496.         },
  497.         h = s.Utf8 = {
  498.             stringify: function(e) {
  499.                 try {
  500.                     return decodeURIComponent(escape(u.stringify(e)))
  501.                 } catch (t) {
  502.                     throw Error("Malformed UTF-8 data")
  503.                 }
  504.             },
  505.             parse: function(e) {
  506.                 return u.parse(unescape(encodeURIComponent(e)))
  507.             }
  508.         },
  509.         l = r.BufferedBlockAlgorithm = a.extend({
  510.             reset: function() {
  511.                 this._data = new o.init;
  512.                 this._nDataBytes = 0
  513.             },
  514.             _append: function(e) {
  515.                 "string" == typeof e && (e = h.parse(e));
  516.                 this._data.concat(e);
  517.                 this._nDataBytes += e.sigBytes
  518.             },
  519.             _process: function(t) {
  520.                 var n = this._data,
  521.                     r = n.words,
  522.                     i = n.sigBytes,
  523.                     a = this.blockSize,
  524.                     s = i / (4 * a),
  525.                     s = t ? e.ceil(s) : e.max((s | 0) - this._minBufferSize, 0);
  526.                 t = s * a;
  527.                 i = e.min(4 * t, i);
  528.                 if (t) {
  529.                     for (var c = 0; c < t; c += a) this._doProcessBlock(r, c);
  530.                     c = r.splice(0, t);
  531.                     n.sigBytes -= i
  532.                 }
  533.                 return new o.init(c, i)
  534.             },
  535.             clone: function() {
  536.                 var e = a.clone.call(this);
  537.                 e._data = this._data.clone();
  538.                 return e
  539.             },
  540.             _minBufferSize: 0
  541.         });
  542.     r.Hasher = l.extend({
  543.         cfg: a.extend(),
  544.         init: function(e) {
  545.             this.cfg = this.cfg.extend(e);
  546.             this.reset()
  547.         },
  548.         reset: function() {
  549.             l.reset.call(this);
  550.             this._doReset()
  551.         },
  552.         update: function(e) {
  553.             this._append(e);
  554.             this._process();
  555.             return this
  556.         },
  557.         finalize: function(e) {
  558.             e && this._append(e);
  559.             return this._doFinalize()
  560.         },
  561.         blockSize: 16,
  562.         _createHelper: function(e) {
  563.             return function(t, n) {
  564.                 return new e.init(n).finalize(t)
  565.             }
  566.         },
  567.         _createHmacHelper: function(e) {
  568.             return function(t, n) {
  569.                 return new d.HMAC.init(e, n).finalize(t)
  570.             }
  571.         }
  572.     });
  573.     var d = n.algo = {};
  574.     return n
  575. }(Math);
  576. (function() {
  577.     var e = CryptoJS,
  578.         t = e.lib,
  579.         n = t.WordArray,
  580.         r = t.Hasher,
  581.         i = [],
  582.         t = e.algo.SHA1 = r.extend({
  583.             _doReset: function() {
  584.                 this._hash = new n.init([1732584193, 4023233417, 2562383102, 271733878, 3285377520])
  585.             },
  586.             _doProcessBlock: function(e, t) {
  587.                 for (var n = this._hash.words, r = n[0], a = n[1], o = n[2], s = n[3], c = n[4], u = 0; 80 > u; u++) {
  588.                     if (16 > u) i[u] = e[t + u] | 0;
  589.                     else {
  590.                         var h = i[u - 3] ^ i[u - 8] ^ i[u - 14] ^ i[u - 16];
  591.                         i[u] = h << 1 | h >>> 31
  592.                     }
  593.                     h = (r << 5 | r >>> 27) + c + i[u];
  594.                     h = 20 > u ? h + ((a & o | ~a & s) + 1518500249) : 40 > u ? h + ((a ^ o ^ s) + 1859775393) : 60 > u ? h + ((a & o | a & s | o & s) - 1894007588) : h + ((a ^ o ^ s) - 899497514);
  595.                     c = s;
  596.                     s = o;
  597.                     o = a << 30 | a >>> 2;
  598.                     a = r;
  599.                     r = h
  600.                 }
  601.                 n[0] = n[0] + r | 0;
  602.                 n[1] = n[1] + a | 0;
  603.                 n[2] = n[2] + o | 0;
  604.                 n[3] = n[3] + s | 0;
  605.                 n[4] = n[4] + c | 0
  606.             },
  607.             _doFinalize: function() {
  608.                 var e = this._data,
  609.                     t = e.words,
  610.                     n = 8 * this._nDataBytes,
  611.                     r = 8 * e.sigBytes;
  612.                 t[r >>> 5] |= 128 << 24 - r % 32;
  613.                 t[(r + 64 >>> 9 << 4) + 14] = Math.floor(n / 4294967296);
  614.                 t[(r + 64 >>> 9 << 4) + 15] = n;
  615.                 e.sigBytes = 4 * t.length;
  616.                 this._process();
  617.                 return this._hash
  618.             },
  619.             clone: function() {
  620.                 var e = r.clone.call(this);
  621.                 e._hash = this._hash.clone();
  622.                 return e
  623.             }
  624.         });
  625.     e.SHA1 = r._createHelper(t);
  626.     e.HmacSHA1 = r._createHmacHelper(t)
  627. })();
  628.  
  629. function Xhr() {
  630.     try {
  631.         return new XMLHttpRequest
  632.     } catch (e) {}
  633.     try {
  634.         return new ActiveXObject("Msxml3.XMLHTTP")
  635.     } catch (e) {}
  636.     try {
  637.         return new ActiveXObject("Msxml2.XMLHTTP.6.0")
  638.     } catch (e) {}
  639.     try {
  640.         return new ActiveXObject("Msxml2.XMLHTTP.3.0")
  641.     } catch (e) {}
  642.     try {
  643.         return new ActiveXObject("Msxml2.XMLHTTP")
  644.     } catch (e) {}
  645.     try {
  646.         return new ActiveXObject("Microsoft.XMLHTTP")
  647.     } catch (e) {}
  648.     return null
  649. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement