PageSourceSearch

https://www.umassglobal.edu/sites/default/files/asset_injector/js/…-bc7f6fdb8fde87c37df58a37ef9d9a6c.js?tlv5va

js umassglobal.edu collected 2026-09-24 19:01:43 UTC 10,169 bytes, 205 lines download raw bytes

1function umgWebFunctions() {
2    this.version = "0.11b", this.author = "Chris Wilden",
3        this.easyRand = function (len) {
4        var randomNumber = [];
5        if (!len) {
6            len = 24;
7        }
8        var mod = parseInt(len / 4);
9        if (len < 12) {
10            for (var i = 1; i <= len; i++) {
11                randomNumber.push(Math.floor(Math.random() * 16).toString(16));
12            }
13        } else {
14            for (var i = 0; i < len; i++) {
15                if (i % mod === 0 && i > 0 && i < (len - 1)) {
16                    randomNumber.push("-");
17                } else {
18                    randomNumber.push(Math.floor(Math.random() * 16).toString(16));
19                }
20            }
21        }
22        return randomNumber.join("");
23    }, this.interactionToken = this.easyRand()
24     , this.days = function (t) {
25        return t = t || 90, new Date(+new Date + 864e5 * t)
26    }, this.hours = function (t) {
27        return t = t || 1, new Date(+new Date + 36e5 * t)
28    }, this.minutes = function (t) {
29        return t = t || 30, new Date(+new Date + 6e4 * t)
30    }, this.getDomain = function (t) {
31        if (t) {
32            var e = document.createElement("a");
33            e.href = t;
34            try {
35                return e.hostname.match(/[^.]*\.[^.]{2,3}(?:\.[^.]{2,3})?$/)[0]
36            } catch (t) {
37            }
38        }
39    }, this.createCookie = function (t, e, n, r, i, o, a, c, s) {
40        var u = {};
41        if ("string" != typeof e) {
42            if ("object" != typeof e) return "Cookie values should be string or object!";
43            u[t] = encodeURIComponent(JSON.stringify(e))
44        } else u[t] = encodeURIComponent(e);
45        return n ? u["Max-Age"] = n || "" : u.Expires = r || "", u.Path = i || "/", u.Domain = o || (typeof document.location.host.match(/[^.]*\.[^.]{2,3}(?:\.[^.]{2,3})?$/) !== 'undefined' && document.location.host.match(/[^.]*\.[^.]{2,3}(?:\.[^.]{2,3})?$/) !== null && 0 in document.location.host.match(/[^.]*\.[^.]{2,3}(?:\.[^.]{2,3})?$/) ? document.location.host.match(/[^.]*\.[^.]{2,3}(?:\.[^.]{2,3})?$/)[0] : ''), u.SameSite = ["Strict", "Lax", "None"].includes(a) ? a : "Lax", u.securityFlags = "Secure;", u.securityFlags += ";", u.Priority = ["High", "Medium", "Low"].includes(s) ? s : "High", u
46    }, this.cookie2String = function (t) {
47        var e, n = "";
48        for (e in t) n += "securityFlags" !== e ? e + "=" + t[e] + ";" : t[e];
49        return n
50    }, this.getCookie = function (t) {
51        var e, n, t = ("; " + decodeURIComponent(document.cookie)).split("; " + t + "=");
52        1 < t.length && (n = t.pop().split(";")[0]);
53        try {
54            e = JSON.parse(n)
55        } catch (t) {
56            e = n
57        }
58        return "undefined" !== e && e
59    }, this.writeCookie = function (t) {
60        if ("string" != typeof t) return "Cookies need to be string.";
61        document.cookie = t;
62        return true;
63    }, this.hashThis = function (t, e, n) {
64        var r = "", s = new Int32Array(7),
65            u = (t = (r = void 0 !== e && "boolean" == typeof e && !0 === e ? n || document.location.hostname.replace(/^[^.]*\.(?=\w+\.\w+$)/gi, "").concat("##") : r).concat(t), {
66                oF: [0, 1518500249, 1859775393],
67                sV: [[3, 7, 11, 19], [3, 5, 9, 13], [3, 9, 11, 15]],
68                xO: [[[0, 1, 2, 3], [4, 5, 6, 7], [8, 9, 10, 11], [12, 13, 14, 15]], [[0, 4, 8, 12], [1, 5, 9, 13], [2, 6, 10, 14], [3, 7, 11, 15]], [[0, 8, 4, 12], [2, 10, 6, 14], [1, 9, 5, 13], [3, 11, 7, 15]]],
69                cR: new Int32Array([1732584193, -271733879, -1732584194, 271733878]),
70                rR: new Int32Array(4),
71                bs: [],
72                dBl: function (t) {
73                    for (var e = 8 * t.length, n = [], r = 0; r < 8 * t.length; r += 8) n[r >> 5] |= (255 & t.charCodeAt(r / 8)) << r % 32;
74                    n[e >> 5] |= 128 << e % 32, n[14 + (64 + e >>> 9 << 4)] = e, u.nbl = Int32Array.from(n)
75                },
76                bO: [function (t, e, n) {
77                    return t & e | ~t & n
78                }, function (t, e, n) {
79                    return t & e | t & n | e & n
80                }, function (t, e, n) {
81                    return t ^ e ^ n
82                }],
83                tr: function (t, e, n, r, i, o, a, c) {
84                    return s[0] = e, s[1] = n, s[2] = r, s[3] = i, s[4] = o, s[5] = a, s[6] = c, s[0] += u.bO[t](s[1], s[2], s[3]) + s[4] + s[6], s[0] = u.rL(s[0], s[5]), s[0]
85                },
86                rL: function (t, e) {
87                    return t << e | t >>> 32 - e
88                },
89                xX: function (t) {
90                    for (var e = "0123456789abcdef", n = "", r = 0; r < 4 * t.length; r++) n += e.charAt(t[r >> 2] >> r % 4 * 8 + 4 & 15) + e.charAt(t[r >> 2] >> r % 4 * 8 & 15);
91                    return n
92                },
93                mE: function () {
94                    for (var t, e, n, r, i = 0; i < u.nbl.length; i += 16) {
95                        for (u.cR.forEach(function (t, e) {
96                            u.rR[e] = t
97                        }), t = 0; t < 3; t++) for (e = 0; e < 4; e++) for (n = 0, r = 2; n < 4; n++, r += 3) u.cR[(2 + r) % 4] = u.tr(t, u.cR[(2 + r) % 4], u.cR[(3 + r) % 4], u.cR[(4 + r) % 4], u.cR[(5 + r) % 4], u.nbl[i + u.xO[t][e][n]], u.sV[t][n], u.oF[t]);
98                        u.cR.forEach(function (t, e) {
99                            u.cR[e] = t + u.rR[e]
100                        })
101                    }
102                    return u.xX(Array.from(u.cR))
103                }
104            });
105        return u.dBl(t), u.mE()}
106     , this.hashThisHard = function (t) {
107        const r = 64;
108        const e = 313;
109        const h = 4294967296;
110
111        function n(t, n) {
112            return t >>> n | t << 32 - n
113        }
114
115        function o() {
116            const t = [];
117            const o = [];
118            const s = {};
119            let c = 0;
120            for (let n = 2; c < r; n++) {
121                if (!s[n]) {
122                    for (let t = 0; t < e; t += n) {
123                        s[t] = n
124                    }
125                    t[c] = Math.floor(Math.sqrt(n) * h);
126                    o[c++] = Math.floor(Math.cbrt(n) * h)
127                }
128            }
129            return {hash: t, k: o}
130        }
131
132        function s(n, t) {
133            n += "€";
134            while (n.length % 64 - 56) {
135                n += "\0"
136            }
137            const o = [];
138            for (let t = 0; t < n.length; t++) {
139                const s = n.charCodeAt(t);
140                if (s > 255) return;
141                o[t >> 2] |= s << (3 - t % 4) * 8
142            }
143            o.push(Math.floor(t / h));
144            o.push(t);
145            return o
146        }
147
148        const c = t.length * 8;
149        const {hash: l, k: a} = o();
150        let f = l.slice(0);
151        let i = s(t, c);
152        for (let t = 0; t < i.length; t += 16) {
153            const u = i.slice(t, t + 16);
154            const p = f.slice(0);
155            for (let t = 0; t < r; t++) {
156                const g = n(p[0], 2) ^ n(p[0], 13) ^ n(p[0], 22);
157                const M = p[0] & p[1] ^ p[0] & p[2] ^ p[1] & p[2];
158                const d = g + M;
159                const m = n(p[4], 6) ^ n(p[4], 11) ^ n(p[4], 25);
160                const j = p[4] & p[5] ^ ~p[4] & p[6];
161                const k = p[7] + m + j + a[t] + (u[t] = t < 16 ? u[t] : (n(u[t - 15], 7) ^ n(u[t - 15], 18) ^ u[t - 15] >>> 3) + u[t - 7] + (n(u[t - 2], 17) ^ n(u[t - 2], 19) ^ u[t - 2] >>> 10) + u[t - 16]);
162                p.unshift(k + d | 0);
163                p[4] = p[4] + k | 0;
164                p.pop()
165            }
166            f = f.map((t, n) => t + p[n] | 0).slice(0,8);
167        }
168        return f.map(o => [...Array(4)].map((t, n) => (o >>> 24 - n * 8 & 255).toString(16).padStart(2, "0")).join("")).join("")
169    },this.getClientData = function () {
170         return new Promise(function (t, e) {
171             var n = new XMLHttpRequest;
172             n.open("GET", "/api/GetLocationFromHeader"), n.onload = function () {
173                 200 === n.status ? t(n.responseText) : e(Error(n.statusText)), n.onerror = function () {
174                     e(Error("Network Error"))
175                 }
176             }, n.send()
177         })
178     };
179     var e = this;
180     this.getNewClientData = this.getNewClientData = async function () {
181         var t = await this.getClientData(), t = JSON.parse(t);
182         t.data && (e.clientData = t.data, e.clientData.trueClientIp && (e.clientData.hashedIP = this.hashThis(e.clientData.trueClientIp, !0)), t = e.createCookie("clientData", e.clientData), e.writeCookie(e.cookie2String(t)))
183     }, this.clientData = {}, this.clientData = this.getCookie("clientData"), this.clientData || this.getNewClientData()
184}
185
186var gUMG = new umgWebFunctions;
187let cookieData = gUMG.getCookie('ip_info_data');
188if(cookieData && !cookieData.hasOwnProperty('status')){
189  gUMG.ip_info_data = gUMG.getCookie('ip_info_data');
190  if(!gUMG.ip_info_data.hasOwnProperty('org') && gUMG.ip_info_data.hasOwnProperty('asn') ){
191    gUMG.ip_info_data.org = gUMG.ip_info_data.asn + " " + gUMG.ip_info_data.as_name;
192  }
193}else{
194  if(typeof gUMG !== 'undefined' && typeof gUMG.clientData !== 'undefined' && typeof gUMG.clientData.trueClientIp !== 'undefined' && gUMG.clientData.trueClientIp){
195    let addr = "https://api.ipinfo.io/lite/";
196    let token = "?token=b981323ef36927";
197    let ip = gUMG.clientData.trueClientIp;
198    fetch( addr + ip + token ).then((response) => response.json()).then((jsonResponse) => gUMG.writeCookie(gUMG.cookie2String(gUMG.createCookie("ip_info_data", jsonResponse,31536000)))).then(gUMG.ip_info_data = gUMG.getCookie('ip_info_data'));
199    gUMG.ip_info_data.org = gUMG.ip_info_data.asn + " " + gUMG.ip_info_data.as_name;
200    gUMG.writeCookie(gUMG.cookie2String(gUMG.createCookie("ip_info_data", gUMG.ip_info_data,31536000)));
201  }else{
202  fetch("https://ipinfo.io/json?token=b981323ef36927").then((response) => response.json()).then((jsonResponse) => gUMG.writeCookie(gUMG.cookie2String(gUMG.createCookie("ip_info_data", jsonResponse,31536000)))).then(gUMG.ip_info_data = gUMG.getCookie('ip_info_data'));
203
204  }
205}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.