@whotracksme/reporting 7.12.2 → 8.0.0

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.
Files changed (31) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/communication/test/helpers/in-memory-database.js +45 -0
  3. package/package.json +2 -2
  4. package/reporting/src/hash-detector-v2/index.js +164 -0
  5. package/reporting/src/hash-detector-v2/prob.js +599 -0
  6. package/reporting/src/hash-detector-v2.js +18 -0
  7. package/reporting/src/observable.js +43 -0
  8. package/reporting/src/pages.js +11 -12
  9. package/reporting/src/paused-domains-reporter.js +50 -0
  10. package/reporting/src/persisted-counters.js +158 -0
  11. package/reporting/src/popularity-estimator.js +625 -0
  12. package/reporting/src/popularity-vote-handler.js +219 -0
  13. package/reporting/src/popularity-vote-sanitizer.js +384 -0
  14. package/reporting/src/random.js +90 -1
  15. package/reporting/src/reporting.js +98 -13
  16. package/reporting/src/utils.js +41 -1
  17. package/reporting/test/activity-estimator.spec.js +3 -2
  18. package/reporting/test/alive-check.spec.js +2 -2
  19. package/reporting/test/country-provider.spec.js +2 -2
  20. package/reporting/test/index.js +6 -0
  21. package/reporting/test/job-scheduler.spec.js +2 -2
  22. package/reporting/test/observable.spec.js +72 -0
  23. package/reporting/test/page-aggregator.spec.js +3 -0
  24. package/reporting/test/patterns-updater.spec.js +2 -2
  25. package/reporting/test/persisted-counters.spec.js +132 -0
  26. package/reporting/test/popularity-estimator.spec.js +710 -0
  27. package/reporting/test/popularity-vote-handler.spec.js +420 -0
  28. package/reporting/test/popularity-vote-sanitizer.spec.js +635 -0
  29. package/reporting/test/random.spec.js +157 -0
  30. package/reporting/test/reporting.spec.js +202 -180
  31. package/reporting/test/utils.spec.js +42 -0
@@ -0,0 +1,599 @@
1
+ /* This Source Code Form is subject to the terms of the Mozilla Public
2
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/. */
4
+
5
+ export default {
6
+ 'logM': [
7
+ [
8
+ -5.245494918595417, -3.7961048510611635, -3.0315428739431214,
9
+ -3.216283803874249, -5.106303884984546, -4.611358914357007,
10
+ -3.677937266215572, -5.081111334847062, -3.412541568909611,
11
+ -5.662624838603896, -4.153289015285919, -2.3403169453088366,
12
+ -3.0852615229967206, -1.8746838803049037, -5.391588810142042,
13
+ -3.6143216771657207, -6.513308099088018, -2.2029363517891807,
14
+ -2.704478522353627, -2.3153820853228884, -3.9022531208732607,
15
+ -4.183893469818334, -5.104304444426749, -5.632127820243874,
16
+ -3.9784790589280696, -5.10575758355709, -6.273341326870322,
17
+ -6.384173963473476, -6.78650571819231, -6.932059698009232,
18
+ -7.010192444626426, -6.967562452040261, -7.095006688327951,
19
+ -7.2189800919671905, -7.194835039311065, -6.888571957083951,
20
+ -5.410197697537061, -2.379185031685336, -6.2252061280829745,
21
+ ],
22
+ [
23
+ -1.9338666511228413, -4.115354075499277, -4.804743167462548,
24
+ -5.231795605830065, -1.7514957172803962, -5.658615864629339,
25
+ -6.106032366637056, -4.987859064860386, -2.382797146749205,
26
+ -5.759297081610098, -6.678481040782219, -2.2507767434689536,
27
+ -5.569205290872216, -5.285217750643784, -2.1073839124398632,
28
+ -5.93993848364004, -7.243427159542086, -2.4164052109728713,
29
+ -3.7278861265254566, -5.042260425260389, -2.633886023448588,
30
+ -6.586025484129106, -6.222556846870899, -7.454542162496876,
31
+ -3.6282837919880278, -6.6407794957891575, -5.173178279709279,
32
+ -5.252890732453652, -5.548154095381564, -5.556351367210155,
33
+ -5.550360037437369, -5.649243887388277, -5.677982851558417,
34
+ -5.702113426225779, -5.666741010893307, -5.407450381295106,
35
+ -5.5226856202303285, -3.35113597656402, -7.513106151032405,
36
+ ],
37
+ [
38
+ -1.9581512115715778, -5.781286153141165, -4.114141199127262,
39
+ -5.658302341441428, -2.2595796472887146, -5.991731589211011,
40
+ -6.569297043879363, -1.8969725739240795, -2.6462179712444525,
41
+ -6.906669466577486, -2.9078800667225386, -3.3764013756909854,
42
+ -5.4031944532174725, -5.960514343223173, -1.7574123416765857,
43
+ -5.699377263142476, -6.912609346296071, -3.198274219922219,
44
+ -4.210773644267849, -2.7098248675358274, -3.3023830902351343,
45
+ -6.718610727102855, -7.253410842528333, -7.589254072050583,
46
+ -4.6354396997405285, -5.827569629111109, -5.638529608332081,
47
+ -6.099646672152765, -6.262330371254385, -6.377172478168715,
48
+ -6.521701016871423, -6.532660846967974, -6.569583944020956,
49
+ -6.542340343814579, -6.551226631906668, -6.602906503660726,
50
+ -5.972171706590539, -3.2768442818617647, -7.244805879349774,
51
+ ],
52
+ [
53
+ -2.4082760322776946, -5.031177848801064, -4.913703134320332,
54
+ -4.273525728225627, -1.473905453424061, -2.839195037851922,
55
+ -4.888511466577124, -5.0881745966873035, -2.1365860549120064,
56
+ -5.975658126003031, -6.409337514711497, -4.627493769126337,
57
+ -4.857806946307063, -5.221313254011592, -2.34464912767834,
58
+ -5.239058243813983, -7.586785965155191, -3.2795278052149293,
59
+ -3.4636278518328827, -4.873182904124815, -3.382425767967566,
60
+ -5.204962866353043, -5.2309175569536865, -7.17897296524956,
61
+ -4.372421867621434, -6.2743583346336465, -5.516386150612464,
62
+ -5.912421019540626, -6.410688173845435, -6.5128776483,
63
+ -6.6134066768392925, -6.393936764717949, -6.75919762442004,
64
+ -6.78950998901256, -6.850984128676855, -6.719826332379505,
65
+ -5.04861402316368, -1.768596391065649, -5.794764574138266,
66
+ ],
67
+ [
68
+ -3.023787988883877, -4.528474199288558, -3.3695911951506283,
69
+ -3.1618167512174002, -3.6817922307844744, -4.550124213605701,
70
+ -4.217036158766878, -5.324702196113439, -4.088880006096533,
71
+ -5.997434091519883, -5.298098017806373, -2.9176453272034033,
72
+ -3.497356046902957, -2.229568383900502, -4.4323329901502975,
73
+ -4.169738440357757, -6.135784646234901, -1.9187905648190078,
74
+ -2.1985601458835533, -3.081749630655362, -4.763009483992821,
75
+ -4.046463226017745, -4.199832478835969, -4.104970835369472,
76
+ -4.717508964911946, -5.685693399256405, -6.6048828758825175,
77
+ -6.662688205915752, -7.221081605956892, -7.434403437352462,
78
+ -7.5741651691250675, -7.5461001898883096, -7.6796134162857985,
79
+ -7.7840079342667625, -7.778472672403204, -7.344366072216476,
80
+ -5.114629279959871, -1.7516842442746479, -5.837693286221448,
81
+ ],
82
+ [
83
+ -2.326924005592731, -5.358210501067634, -4.763730841872416,
84
+ -5.325139418117154, -2.2554073756423847, -2.8358950014919224,
85
+ -5.836716480460096, -5.9264665392564195, -1.8563025733765115,
86
+ -6.944925647642563, -6.517709485347196, -3.0958015529856353,
87
+ -5.169623917958201, -5.777579749161622, -1.8736236314988057,
88
+ -5.181620483905637, -7.840832003788769, -2.4571654500306805,
89
+ -4.5030058783669356, -3.1232039594384218, -2.93270129035448,
90
+ -6.751700278194695, -5.889620469621047, -6.693363458520636,
91
+ -5.072065950921831, -7.1557009750811975, -5.549031833624719,
92
+ -5.791935922003298, -6.102149483994536, -6.102740488652468,
93
+ -6.225703015986803, -6.237832622009062, -6.285947863081036,
94
+ -6.270654229206857, -6.320849874985024, -6.080642564520867,
95
+ -5.648133918795825, -2.228857159196506, -6.070990320788062,
96
+ ],
97
+ [
98
+ -2.2269329665438757, -4.623033838616507, -5.434326430630099,
99
+ -5.212213848464087, -1.7402561667376224, -5.407697267730225,
100
+ -4.306592833017785, -2.942150481697458, -2.4866442447236485,
101
+ -7.128913750478723, -6.019539235923753, -3.333578526556282,
102
+ -4.8090992280797495, -3.67813683257679, -2.6418339834620514,
103
+ -5.0424073969338705, -7.6568904186552675, -2.5381599796073733,
104
+ -3.5904828792676615, -4.322234548758003, -2.7884486730363602,
105
+ -6.597896416221336, -5.565392012002056, -7.234012939247793,
106
+ -4.279328765239528, -7.303228634283332, -5.500916409014055,
107
+ -5.865101868971976, -6.274848818712153, -6.758090615511717,
108
+ -6.797822031720953, -6.845710968830989, -7.473294270274188,
109
+ -7.781918967746052, -7.711339918810952, -7.3601204480192814,
110
+ -4.904347417467138, -1.797651044940773, -5.653439129695516,
111
+ ],
112
+ [
113
+ -1.8209932621592928, -5.673520918129602, -5.667103799163052,
114
+ -5.0379751856775785, -1.4716693715442035, -6.223921130019465,
115
+ -6.492012564915035, -6.291752561707656, -2.252877025268876,
116
+ -7.296966540734873, -6.320559064672449, -4.758345052396063,
117
+ -5.0533281737108755, -4.443483264320923, -1.9434811150587994,
118
+ -4.728608544170337, -7.328281100695382, -3.8075127801072073,
119
+ -4.881783728805176, -2.015668875731053, -3.715457510353785,
120
+ -6.761691161687972, -5.410675775038697, -7.652136881102912,
121
+ -3.870890336452528, -6.663066936469046, -6.801407415414013,
122
+ -6.758098858860228, -7.596163582815313, -7.86820913888212,
123
+ -8.021139483468275, -7.980833867917352, -8.262265018442815,
124
+ -8.402810190160379, -8.477704960003352, -7.622156781427578,
125
+ -5.768954723870805, -2.554194410791536, -6.570378792838812,
126
+ ],
127
+ [
128
+ -2.9535624218968746, -4.611473261097065, -2.506406644688062,
129
+ -3.1721061716908814, -2.835124258498358, -4.059467986860758,
130
+ -3.5171829711828306, -6.346500430769967, -5.545486414868504,
131
+ -5.934267285555771, -4.385955514989475, -2.895323564535748,
132
+ -3.4603546548904776, -1.549584966399055, -2.6192970997357907,
133
+ -4.106919321453227, -5.702185875496139, -3.3377489732784618,
134
+ -2.4446743856265147, -2.4917259944808268, -5.509771999843053,
135
+ -3.6676863004786844, -6.82958915901068, -5.28801138096066,
136
+ -6.3093601096774465, -4.7125620144670535, -7.743397984495961,
137
+ -7.823950234410587, -8.396274850119019, -8.906582444130311,
138
+ -7.851997809063298, -8.239723857296418, -8.516342209879106,
139
+ -9.445110238337932, -9.05789556474244, -8.68687006226516,
140
+ -6.238429902175551, -3.2272388325981813, -7.1940057418074534,
141
+ ],
142
+ [
143
+ -1.4019160365100196, -5.231713636032204, -4.8452485721925935,
144
+ -5.075309148180334, -1.7464533367659203, -5.345305016272297,
145
+ -5.906841866926231, -5.3352131620676095, -2.89415747925744,
146
+ -5.338833400645912, -4.89153684091339, -5.409949430942381,
147
+ -4.740147507809456, -4.740992247074995, -1.5674739482406161,
148
+ -4.4758371482015855, -6.6073201170852895, -4.654138227696087,
149
+ -3.9487636448517556, -5.525917109070722, -1.9855636676297694,
150
+ -5.618152606731933, -5.826714600999054, -6.766157419042489,
151
+ -5.983375004023567, -6.2730369353642255, -5.498961210302464,
152
+ -6.321251216342777, -6.855847101793971, -6.574162025091472,
153
+ -7.048201784564105, -7.11894994903682, -7.045299468313114,
154
+ -7.140190272980238, -7.167477443495485, -6.2724381645874825,
155
+ -5.031912748288813, -3.3995620726571243, -7.992728956427435,
156
+ ],
157
+ [
158
+ -2.152353325512735, -5.05789340724744, -5.1298935063339535,
159
+ -5.238182648995995, -1.6209246826199974, -5.119921806718188,
160
+ -5.099274761792153, -4.261760316896291, -1.951694819792354,
161
+ -6.451162381363983, -4.8189134239909555, -3.76462794879719,
162
+ -4.827605748780058, -3.67407311005091, -2.7195770941655266,
163
+ -4.950386689215595, -7.451530902325927, -3.877910596587822,
164
+ -2.8558443367921975, -3.335878258977703, -3.3434702586228005,
165
+ -5.830849702462292, -5.091532163229189, -7.260947461866981,
166
+ -3.932092614696782, -6.71231256789859, -6.096850834905614,
167
+ -6.105626149270844, -6.979778549600871, -7.091700163840521,
168
+ -7.2453707270338645, -7.332609833093539, -7.590272306278541,
169
+ -7.54088266847826, -7.560698431071281, -7.261443986206874,
170
+ -4.458591669417668, -1.8582608563682985, -5.680570089131375,
171
+ ],
172
+ [
173
+ -1.9059106477722951, -5.103857826532222, -4.730831032240563,
174
+ -3.4947294499760844, -1.6987530030647204, -4.878935735754962,
175
+ -5.362440569871994, -5.533098484621245, -2.0142854059145487,
176
+ -7.054097901583666, -5.039845183986037, -2.3734858751487975,
177
+ -4.540021781653518, -5.6145026174760915, -2.3853178509419135,
178
+ -4.78179463464094, -7.67800281887946, -5.80693225871194,
179
+ -3.6251185204730665, -3.5410193986913363, -3.38425665702804,
180
+ -5.046820667619583, -6.009311720077812, -7.7029213848470155,
181
+ -3.4576205492238197, -6.793329011075329, -6.777000814197169,
182
+ -6.849784170984587, -7.650818670698164, -8.026884298457459,
183
+ -8.11368671819882, -8.358748570847796, -8.490168664099823,
184
+ -8.544553555502558, -8.601505859661982, -7.832475420333964,
185
+ -5.139521647276668, -2.2036554131712887, -5.993355049044516,
186
+ ],
187
+ [
188
+ -1.649974167268183, -3.6598272040250706, -4.351944048123222,
189
+ -5.407249695170541, -1.686602755332333, -5.910407984535038,
190
+ -5.7819642705542575, -6.307994531625355, -2.2462934144326794,
191
+ -7.246626307080119, -6.46040113550944, -2.370587748061452,
192
+ -3.5734515670827243, -5.577630044714639, -2.2669247836279705,
193
+ -2.852654714554382, -7.99634624229541, -5.593102658382967,
194
+ -3.7149611336349126, -5.404865333756338, -3.424387980456754,
195
+ -6.61608382280142, -5.981999817900735, -6.712883476832435,
196
+ -3.909688861350092, -7.489815677363582, -6.201091684472796,
197
+ -6.386870817669843, -7.004810070987666, -7.081754411237708,
198
+ -7.348118246158226, -7.670409474394447, -7.79451034222082,
199
+ -7.977924638160173, -8.110834748391873, -6.8319170016953645,
200
+ -5.0543869264143115, -2.6607709479414097, -6.658625490439598,
201
+ ],
202
+ [
203
+ -2.575696551493727, -5.415121658829284, -3.168474609814487,
204
+ -2.269486746908972, -2.3153687863824928, -4.562639442264389,
205
+ -2.2259327418126165, -5.137027605843352, -2.7771077256241,
206
+ -5.825692128276764, -4.431598117698226, -4.585642923201459,
207
+ -5.219856607240545, -3.8948113083417497, -3.0063150106228296,
208
+ -5.59370329771254, -6.986677707510632, -5.5333719546877145,
209
+ -2.818148949158717, -2.2262191292292997, -4.217594053748542,
210
+ -4.963743210223847, -5.93609245105295, -6.967184865549447,
211
+ -4.397244876319164, -5.6148446132943155, -6.535964550967162,
212
+ -6.6395254913681025, -7.490725457802552, -7.958469956153135,
213
+ -7.860325584924435, -8.039059083006707, -7.49257607484424,
214
+ -8.12869488010928, -8.297611320134365, -7.704787668192438,
215
+ -5.091077281411213, -1.8583296771502156, -5.80904988300038,
216
+ ],
217
+ [
218
+ -4.40690757970279, -4.1621457966881295, -3.707717591685986,
219
+ -3.4838328275789157, -4.5483585014191865, -3.242660302954745,
220
+ -3.971641989558103, -5.35739842247689, -4.18494289393036,
221
+ -5.77794264168111, -4.17923383996391, -2.9223666107612605,
222
+ -2.8004237846137556, -1.77905312805921, -3.4533453772688145,
223
+ -3.564521513467157, -7.360205990792272, -2.0353654733280844,
224
+ -2.9525519140506042, -3.2105868148477508, -2.7535076017514704,
225
+ -3.930796647893879, -3.1490464979697257, -5.250248905186486,
226
+ -4.925217474195957, -5.9428131555899375, -7.295238156120438,
227
+ -7.288505996383162, -8.169844530417555, -8.414224636375105,
228
+ -8.841645653519882, -8.742295304236809, -8.757183574647561,
229
+ -8.97668224078951, -8.98743550006714, -8.326206237512583,
230
+ -5.7437186681257275, -2.3610454951927924, -6.62124756512507,
231
+ ],
232
+ [
233
+ -2.0272526724308118, -5.895078888179572, -4.684783237389261,
234
+ -2.5634616567744453, -2.0978186004356374, -5.516039355064479,
235
+ -5.657096101311485, -3.1405216975612085, -2.726912721208637,
236
+ -7.533533429566948, -6.145005452261917, -2.557549096405194,
237
+ -4.304291323364267, -5.643391916984188, -2.179770766177894,
238
+ -3.280144557161981, -8.204983744660794, -2.1503476915327044,
239
+ -3.4387036948739507, -3.5302414059694653, -3.4249645733442335,
240
+ -6.289576726358759, -6.3836107016756385, -5.562009983183076,
241
+ -4.834354159282883, -7.6424765854968255, -6.069056991266446,
242
+ -6.29828377952229, -6.409987861276944, -6.83103235814667,
243
+ -7.176593499991675, -7.605040181083142, -7.814969863208891,
244
+ -7.678765023058659, -7.899864335542483, -6.898258750722412,
245
+ -5.630936265551914, -2.9721394790128484, -7.1439083808436035,
246
+ ],
247
+ [
248
+ -4.385944412028377, -5.446021329844913, -5.387096495012738,
249
+ -5.611732014841357, -5.535389288503697, -5.773710458103008,
250
+ -5.9732200855989035, -5.697492398786441, -4.707975126723983,
251
+ -6.269576235014427, -6.32251952496805, -4.145979588354135,
252
+ -5.549225734153534, -5.725871938566152, -5.423890258957206,
253
+ -5.601827348046264, -5.772229034105908, -5.045714141259653,
254
+ -4.654657246631102, -4.7209471263690705, -0.23261154914943424,
255
+ -5.813668021939993, -5.360395467070968, -6.0720609718717125,
256
+ -6.245651043185673, -6.287479443852254, -4.742456587285392,
257
+ -5.341453909239753, -5.115518755190179, -5.145080991572925,
258
+ -5.804211495619433, -6.156094281257435, -6.209656492917031,
259
+ -6.3754279780029135, -6.446161919312819, -6.3526181189603745,
260
+ -5.273947675185774, -3.1894891538224184, -8.490459432759094,
261
+ ],
262
+ [
263
+ -2.034451664430439, -4.733294946873862, -3.985296841600695,
264
+ -3.6145791178918687, -1.6950784800557812, -5.014203556354734,
265
+ -4.156637580605779, -5.701702588165195, -2.21949772466263,
266
+ -6.8007425347759405, -4.1463204205628985, -4.2340713701583015,
267
+ -3.8484198950625026, -3.7672978361330283, -2.3058536966975964,
268
+ -4.879192230491958, -6.811775669650649, -3.9782542954256193,
269
+ -3.054764270150532, -2.950649310768123, -3.7372981174304276,
270
+ -4.628847791198543, -5.769827320673443, -7.193599167980211,
271
+ -3.6543121787679387, -5.959293003677127, -6.765957158102037,
272
+ -6.756556453038095, -7.5329640912276545, -7.734545613634418,
273
+ -7.87845169354181, -8.119110361617912, -8.315503244067521,
274
+ -8.529734924167682, -8.615889871236234, -7.869175482528663,
275
+ -5.3560109842882575, -2.1439629819288193, -6.290079853550714,
276
+ ],
277
+ [
278
+ -2.912970422843931, -5.061803647970502, -3.325994239759462,
279
+ -5.242003543693264, -2.310585548117833, -5.090917521757883,
280
+ -5.820297488181997, -3.1157318968787866, -2.5960971455707935,
281
+ -7.089040250557652, -4.382108359253569, -4.5505667371826295,
282
+ -4.321987376095197, -5.175872995449495, -2.9048284523868846,
283
+ -3.422369874354675, -5.989972181537051, -5.4611721214724,
284
+ -2.953246716632723, -1.8541362126571437, -3.3882233678944704,
285
+ -6.075983339325523, -4.737061476518533, -7.3573357594632345,
286
+ -4.535114719746304, -6.222644864989884, -5.600145614624927,
287
+ -5.879177793984159, -7.124577858404474, -6.420099694923828,
288
+ -7.131319959608019, -7.914840370261032, -8.104733273032323,
289
+ -8.325612801721139, -8.196186739189704, -5.713404359296154,
290
+ -4.310356999061199, -1.444078894176579, -5.688172107914243,
291
+ ],
292
+ [
293
+ -2.3990581695961204, -5.562747937418678, -4.534456217392488,
294
+ -5.670954294787071, -1.9489808081010638, -5.473050296999022,
295
+ -6.043107404037207, -2.240560716948575, -2.0522208557812878,
296
+ -7.346063223825315, -6.588108603597471, -4.745945002535071,
297
+ -2.9512318756222427, -5.698370090342874, -2.233567898804109,
298
+ -5.436385080479218, -8.17291733632117, -2.768577128310835,
299
+ -3.27756514780404, -3.5678441889223915, -3.4574063947025837,
300
+ -5.64128253154953, -4.810472434418422, -6.625986688186654,
301
+ -3.9187253713007864, -5.986060461440278, -6.409065746558692,
302
+ -6.538833687082922, -7.0433624899435845, -7.5975011143401625,
303
+ -7.779753127266271, -7.95545332876811, -8.11413405221403,
304
+ -8.234858224468928, -8.40465876617391, -6.921274321070041,
305
+ -5.315640924949083, -2.1200876195304255, -6.389326575617264,
306
+ ],
307
+ [
308
+ -3.3128410966401947, -3.499135381868273, -3.1946263911531174,
309
+ -3.509452532383405, -2.6379102338127636, -4.773335125288472,
310
+ -3.8130089195898496, -5.836507201723508, -3.0372126847864465,
311
+ -5.510521018784679, -4.608229451135805, -2.623598784183918,
312
+ -3.023188333865532, -2.119103361283064, -4.976700265113731,
313
+ -3.292169607872125, -7.495340242124566, -1.9749462645136588,
314
+ -2.191473668189572, -2.475078721296961, -6.037234846155981,
315
+ -5.2150706698615945, -6.406825222702314, -4.75708626888882,
316
+ -5.14913599949653, -5.346944805275568, -7.68191712448866,
317
+ -7.552531236683248, -8.287750140246034, -8.758760120466777,
318
+ -8.791285111338604, -8.873025349560313, -8.698923366803257,
319
+ -8.980353768679537, -8.991006696520328, -8.30167703645991,
320
+ -6.295594952501207, -3.178313993028894, -7.794254737150906,
321
+ ],
322
+ [
323
+ -2.015155177103273, -6.5337044712413865, -5.761387942567602,
324
+ -5.610639177571509, -0.9897802459254663, -6.578238455059033,
325
+ -6.216713165221888, -6.770307215460878, -1.2749525923896357,
326
+ -7.4034191615522325, -6.661629347466812, -5.463859222022324,
327
+ -5.785993465610575, -5.865525818743494, -2.576511821932119,
328
+ -5.426349116204882, -7.943226520869354, -4.59143101626342,
329
+ -3.6177481196621017, -5.795297859142493, -5.0367938615407235,
330
+ -6.473184538374443, -6.7078557441033935, -7.387363018407136,
331
+ -5.0278360939835, -7.312037337986113, -4.990308869774007,
332
+ -5.507587903965453, -6.240766665866659, -6.6024118942441214,
333
+ -7.013777001837709, -6.807412997927191, -7.273095246488424,
334
+ -7.19628246407649, -7.602200406653095, -6.476747054607605,
335
+ -5.785047760731149, -3.5170158578017783, -7.715518900929225,
336
+ ],
337
+ [
338
+ -1.9108566959897528, -5.399001920482517, -5.277193677667442,
339
+ -4.479205124025612, -2.1405521036911694, -5.9271834798126894,
340
+ -5.9925816756981725, -1.980371235321023, -1.8132886254801175,
341
+ -6.0921969052018685, -5.921158524224526, -4.876890911568583,
342
+ -5.340149624979549, -3.3974393548338044, -2.347196551957088,
343
+ -5.552772421316929, -7.54703722707169, -4.382072748268925,
344
+ -3.112415157185056, -4.252504409390165, -5.419075062525052,
345
+ -6.864295110818319, -4.523742162089688, -7.42062423307248,
346
+ -5.04409594815502, -7.31135026670482, -6.467609668243631,
347
+ -6.404891502340469, -7.079368115009979, -7.660093394873714,
348
+ -7.742438704251217, -7.798436765810063, -7.9390584638903565,
349
+ -7.946081469503051, -7.953321824162615, -7.032547029940265,
350
+ -4.9645308580581675, -1.9256198168344432, -6.912999684760786,
351
+ ],
352
+ [
353
+ -2.909394767065907, -4.34865337368915, -3.4496953886677373,
354
+ -5.166352251682597, -2.916987771317808, -4.833711888747279,
355
+ -5.473146668157501, -4.223228442126965, -2.422568008087792,
356
+ -6.3383446674016986, -6.186949933229566, -4.528029476498865,
357
+ -4.451659694284607, -5.067156732506897, -3.716601094082977,
358
+ -2.2929511158214186, -6.5083304700142675, -5.076487630867075,
359
+ -4.501221245597401, -2.441133094829735, -3.9175205592166162,
360
+ -4.774268308249168, -5.33158363370736, -2.7651857642033852,
361
+ -3.474035195806713, -6.376255794746144, -4.345340942851313,
362
+ -4.2528639179950245, -4.910002532794756, -5.143228844089696,
363
+ -5.337490688715637, -5.509232517089177, -5.834071705676405,
364
+ -5.419337443925176, -5.963638106616571, -5.705676800870363,
365
+ -4.285453495005839, -1.3824321737113197, -5.171771083118707,
366
+ ],
367
+ [
368
+ -2.8301177700490725, -4.0273314414777674, -3.690277463144211,
369
+ -4.080849137315797, -3.0477545302132487, -4.28931446411366,
370
+ -4.7358607316673265, -5.03086340560854, -3.8905598025296184,
371
+ -5.887624104467445, -5.259382187245083, -3.5944311180737247,
372
+ -3.6112437808649545, -3.767892480526539, -2.253195568152589,
373
+ -3.5909191494834207, -6.9375725858217425, -3.889806034356384,
374
+ -2.621622566900872, -3.5370737454481778, -4.333967028577775,
375
+ -5.632526484977437, -4.608366114066191, -6.374558063155261,
376
+ -6.013003774920137, -5.467239931709326, -6.246619450596053,
377
+ -5.912622345416287, -7.186405109453839, -7.398092628132601,
378
+ -7.5965405138827675, -7.745609485449348, -7.638867864156462,
379
+ -7.884782454016815, -7.870878946347265, -7.3301392252327044,
380
+ -4.244162300016263, -0.9793497969215557, -4.688008364123455,
381
+ ],
382
+ [
383
+ -1.7106808151863608, -4.79783625875739, -4.913951346931985,
384
+ -4.325355181766096, -1.6457029695041527, -5.201674067947235,
385
+ -5.290151033459929, -3.98227035450413, -2.178826273665485,
386
+ -6.036620235231684, -4.678225824131995, -4.22710404441437,
387
+ -4.712202504465538, -4.028371186731351, -2.3965391967408993,
388
+ -4.91958595958675, -6.257057814487689, -5.107754324397194,
389
+ -4.881929486233566, -4.376690133273896, -2.9733227997636367,
390
+ -5.4574188050179435, -4.629755415680392, -6.200882107484732,
391
+ -3.4592730777409453, -3.107991432936948, -5.8751049512429185,
392
+ -6.084383283008264, -6.469274150612626, -6.61726060686013,
393
+ -6.559850362958355, -6.766674356828591, -6.687133337184669,
394
+ -6.822521124435034, -6.853027937412382, -6.084262345744322,
395
+ -4.886573415141132, -2.233086724796469, -6.575538497241516,
396
+ ],
397
+ [
398
+ -5.249074888113533, -5.404814143439453, -5.910424341680806,
399
+ -6.066487942116482, -5.776789505592435, -6.0094755572026894,
400
+ -7.196765129117316, -7.235035276868746, -7.184873046462817,
401
+ -6.790709891226257, -7.101232325606072, -7.216725643782853,
402
+ -6.773462076895873, -7.24736457788741, -7.473629262884856,
403
+ -6.15865030380955, -8.09360607457603, -7.279053826115275,
404
+ -6.1615432308549405, -6.616416254570484, -7.776980678102228,
405
+ -7.282106325284451, -7.46728805613169, -6.92885139668216,
406
+ -8.188911635240023, -8.045539839369956, -2.306131890792064,
407
+ -2.330952930697172, -2.5324271202154853, -2.555125133599305,
408
+ -2.4821734868260292, -2.5690339223619976, -2.617837182674276,
409
+ -2.585982613241637, -2.507922750942588, -1.9673289826837068,
410
+ -3.7585352904102667, -2.8997224869854494, -7.713890383141021,
411
+ ],
412
+ [
413
+ -5.285262675001295, -5.409836508652868, -5.7849899127798,
414
+ -5.848345740416518, -5.842313209228044, -5.968498189083415,
415
+ -6.401192442824903, -7.093993656175447, -6.994122619440446,
416
+ -7.8892135631134686, -6.93287116439489, -7.105953177126428,
417
+ -6.601163234950327, -6.5080535343899735, -7.217340312257868,
418
+ -6.404750094151255, -8.164140786490158, -6.982786226881982,
419
+ -6.4649190406610035, -6.562290778399793, -7.64825314765794,
420
+ -6.799118972048376, -7.1907175933842336, -6.54366937160026,
421
+ -8.06775984465442, -8.023534469651683, -2.493251406436546,
422
+ -2.4973445978163324, -2.532488636041754, -2.504681506323693,
423
+ -2.388166377416137, -2.5170861494618832, -2.7869288880550567,
424
+ -2.7921994652289994, -2.821983328129943, -1.608594531169849,
425
+ -3.940876632561111, -2.8374205108791295, -7.680717675864646,
426
+ ],
427
+ [
428
+ -5.032010415455656, -5.2137818995567455, -5.580800254523473,
429
+ -4.828264053400648, -5.682179455421363, -5.780188387650954,
430
+ -7.018917197554034, -7.072898479645756, -6.86868514424529,
431
+ -7.685740372971905, -7.3944462755134195, -7.031536331198182,
432
+ -6.442250109425248, -7.024252047635229, -7.329293755175224,
433
+ -6.409339664873551, -7.927537720850272, -6.34095599696737,
434
+ -6.300953928699691, -6.637314135744979, -7.442571290895249,
435
+ -6.988333068189283, -7.224409695715625, -6.617993921187197,
436
+ -7.837246272415738, -7.827517952063211, -2.3880496581420436,
437
+ -2.4228538416186653, -2.4910142405816083, -2.5025800184190237,
438
+ -2.469568340857708, -2.4714008548027318, -2.5227524099695984,
439
+ -2.5442466541064745, -2.5588638339139647, -2.1885087122101896,
440
+ -3.7994405781380842, -2.7301007962472594, -7.596471375557683,
441
+ ],
442
+ [
443
+ -4.939809747462259, -5.055196999390264, -5.424732772231673,
444
+ -5.493631677437994, -5.533444091697112, -5.5874749602026625,
445
+ -6.163588294732562, -6.7007825464001725, -6.84216001193337,
446
+ -7.639686835095549, -5.725893936420492, -6.918881380793047,
447
+ -6.422781744094123, -7.050855170780415, -7.206323003602841,
448
+ -6.321345399277309, -7.916656852144231, -6.835459191921669,
449
+ -6.383215788864123, -6.222223371583039, -7.150822194569844,
450
+ -6.752566347020975, -6.985749242733386, -6.377951649105416,
451
+ -7.784693583332682, -7.716647876231678, -2.3879717553042523,
452
+ -2.4403759907224565, -2.4980346639094098, -2.4841443702123307,
453
+ -2.4684093386184474, -2.532073718941387, -2.524532708897291,
454
+ -2.5431986606910577, -2.554981226855529, -2.2152247792789077,
455
+ -3.773582304094143, -2.692856615676209, -7.5105804597087,
456
+ ],
457
+ [
458
+ -5.023896694924363, -5.17751584752227, -5.469537236045663,
459
+ -5.614523995239371, -5.472645513612243, -5.591463082549878,
460
+ -5.728459210094198, -6.6348288487909635, -6.704078626117363,
461
+ -7.6905345062315655, -6.845175150503703, -6.767650807225163,
462
+ -5.86018994301924, -7.054486357844368, -7.239524414319871,
463
+ -6.354137787032812, -7.729851368608515, -6.892625489330715,
464
+ -6.421869962048036, -6.219052169405025, -7.184450420202834,
465
+ -6.8658017485800515, -6.44948712978596, -6.472044001654174,
466
+ -7.680156851584663, -7.8432440559636065, -2.4491357580516637,
467
+ -2.489725243200613, -2.5399385906550918, -2.5419238101009,
468
+ -2.500561517004651, -2.4902542820374047, -2.550160455793915,
469
+ -2.5688439530250857, -2.545967777754999, -2.1560974762054714,
470
+ -3.7753983821636203, -2.49647393708716, -7.565566499300712,
471
+ ],
472
+ [
473
+ -5.022403811882347, -5.159376380284438, -5.636424015806467,
474
+ -5.71335814729334, -5.620662649364569, -5.724243503998369,
475
+ -5.959573026146494, -7.235293841942862, -6.87484287583467,
476
+ -7.6663429632811315, -7.399452139923536, -7.107981284893065,
477
+ -6.583954339530476, -7.174686666703555, -7.4778619407739155,
478
+ -6.610274854908514, -7.992643465667126, -7.126341169894076,
479
+ -6.53943161590416, -6.4645023559250365, -7.674694593023204,
480
+ -6.89882160532165, -7.328661602331211, -6.616432095826368,
481
+ -7.94314741399889, -7.820197863875851, -2.4084982113990314,
482
+ -2.434742528915086, -2.4662255658914747, -2.454315548881584,
483
+ -2.4726144530880725, -2.5018746450151825, -2.518004125927749,
484
+ -2.529203334348672, -2.5162728392514704, -2.205532467558003,
485
+ -3.872890615331823, -2.6867925266472965, -7.920203500331006,
486
+ ],
487
+ [
488
+ -5.021926718724648, -5.1498197469103815, -5.647532290902766,
489
+ -5.714807807568865, -5.640632152145744, -5.751874110448817,
490
+ -7.21477525577168, -7.334458861557941, -6.961716483924215,
491
+ -7.6580391171137245, -7.4975909271358825, -7.185608533519475,
492
+ -6.822330651201034, -7.244818299112013, -7.4951665785741195,
493
+ -6.700701287564741, -7.899853678344285, -7.183421701176623,
494
+ -6.474771795247643, -6.5020253126231875, -7.785345242961172,
495
+ -7.039759602673535, -7.530953060548366, -6.812647737882611,
496
+ -7.989567105933367, -7.667446620412213, -2.410817940354867,
497
+ -2.4345778994895846, -2.4407321374579913, -2.4165172192654314,
498
+ -2.303635725799537, -2.4929298385958, -2.5172940493464426,
499
+ -2.380850216960019, -2.5502396473560482, -2.311213206289303,
500
+ -3.916365853810008, -2.9645697300642464, -8.033848098249386,
501
+ ],
502
+ [
503
+ -4.972261549954628, -5.0563398463579485, -5.548663094487513,
504
+ -5.617609859749907, -5.596691660750651, -5.655387265997721,
505
+ -6.041529090540559, -7.220995610562368, -7.018562194441725,
506
+ -7.767899180186285, -6.994773896503755, -7.2317461504016824,
507
+ -6.622183526404975, -6.996242467958761, -7.6060313324222655,
508
+ -6.635820014050358, -7.967257666252701, -7.2237072409393575,
509
+ -6.696816959192798, -6.431478353312634, -7.767719232370666,
510
+ -6.755982018143936, -7.453784893936501, -6.667588674237762,
511
+ -7.533896981518009, -7.932572940339285, -2.374232097068476,
512
+ -2.4294415151271873, -2.478301483349324, -2.480705237815307,
513
+ -2.471999851714004, -2.4808729740154924, -2.4843797268859724,
514
+ -2.4685017132934663, -2.48454229584114, -2.250108817812729,
515
+ -3.84983447463733, -2.8431699135775115, -7.8190346238687045,
516
+ ],
517
+ [
518
+ -4.993669316233094, -5.126292731570553, -5.6086907047866355,
519
+ -5.6755122229994726, -5.609811823546616, -5.680433587041439,
520
+ -7.456926255545279, -7.399680562630434, -7.118044176639221,
521
+ -7.785192747334562, -7.591992510427134, -7.370999228725031,
522
+ -6.621330156000606, -7.244858919592694, -7.728017500659812,
523
+ -6.505812107903647, -8.007927340955046, -7.286450499773954,
524
+ -6.713294565287406, -6.513852437283477, -7.92918432252988,
525
+ -7.082186438146846, -7.607193125232582, -6.815798458998725,
526
+ -8.007624517120496, -7.91019026751627, -2.4067435503586414,
527
+ -2.4315808003289296, -2.474501939470383, -2.472602796174751,
528
+ -2.4772707023377025, -2.481349228609699, -2.3244647622080987,
529
+ -2.4502769578901824, -2.3930730416242523, -2.3067906489535903,
530
+ -3.866204599105112, -3.039380480725953, -7.929954441936444,
531
+ ],
532
+ [
533
+ -5.36346108162638, -5.566829977281173, -5.7333655930336,
534
+ -5.967409826499522, -5.967692834986424, -5.960417758703401,
535
+ -6.146243337339775, -6.625888241531834, -6.930397507320521,
536
+ -8.036104124819348, -6.482124210851826, -6.939193681611072,
537
+ -5.343385968398718, -7.164163363025585, -7.509274209893247,
538
+ -5.959840320898475, -8.225835281346116, -6.892048816386967,
539
+ -5.82306120706475, -6.255682464251266, -7.226575760752762,
540
+ -6.752262176959917, -6.586378669567383, -5.897102191101859,
541
+ -7.863276453076856, -7.961063442453231, -2.2276001491824795,
542
+ -1.9840697995081855, -2.722915715827408, -2.8096617919265565,
543
+ -2.8220270491503467, -2.820612015770741, -2.8473860428100792,
544
+ -2.8796045928206397, -2.8997340099963655, -1.6069363915313708,
545
+ -4.036465454217539, -2.6091165107624783, -7.638828843306662,
546
+ ],
547
+ [
548
+ -3.622087038584707, -5.015258087135991, -3.3698796779484845,
549
+ -4.571617427676642, -5.013968533318693, -4.646606178245308,
550
+ -4.804668693596093, -0.9294154388170145, -5.206515288617308,
551
+ -5.472562016709296, -5.781032198371653, -5.3958315130353816,
552
+ -4.599867974846379, -5.282373343060574, -5.190878455843793,
553
+ -1.319164990666205, -7.744599877244192, -5.368350396727632,
554
+ -4.145860497880676, -4.760498795170157, -6.203823212782967,
555
+ -5.827419570851227, -5.469632018391308, -5.938489118838612,
556
+ -7.449456197273922, -7.15131937699861, -3.157764821856066,
557
+ -3.3892429571935874, -4.477878726562496, -4.88274999516688,
558
+ -4.786489834761434, -5.132451702712734, -5.128803815399776,
559
+ -5.596495057033092, -5.287230905979594, -3.792826271884864,
560
+ -6.416651943729767, -5.359835815508758, -6.3957333497298645,
561
+ ],
562
+ [
563
+ -2.588789266667547, -3.1557755884252856, -2.704048477731642,
564
+ -2.8561187327527957, -3.2551019404850665, -3.2156010311271412,
565
+ -3.5434261813062893, -3.6020138814288005, -3.135974529889684,
566
+ -4.68164755034173, -4.33423509955731, -3.318345217727428,
567
+ -2.995552691333775, -3.7554718386423955, -3.3706657840993155,
568
+ -2.8648743548768563, -5.265553147849728, -3.3294138827580064,
569
+ -2.5641677560900766, -2.7040832944723068, -4.1709701747828465,
570
+ -3.9478576938822663, -3.5268030371633947, -5.736810014159014,
571
+ -4.640120568444579, -5.588404823385067, -3.7970863172876603,
572
+ -3.8989642372570925, -4.824582044235045, -5.020722651297661,
573
+ -5.1259182929235285, -5.416578202384904, -5.558654316134694,
574
+ -5.59219944002037, -5.5824740117745, -4.88633246778598, -8.70000955786042,
575
+ -5.651226169375358, -8.370755949908983,
576
+ ],
577
+ [
578
+ -2.5513238766503283, -2.9390854851873303, -2.5484863619404594,
579
+ -2.9282664783045793, -3.3851255031073713, -3.0059219927543834,
580
+ -3.373378657165348, -3.499306684207177, -3.381754637648953,
581
+ -4.459567757742748, -4.403166207245495, -3.3283898054400956,
582
+ -2.79451665940008, -3.806196441731741, -3.339460029194342,
583
+ -2.6686406319658906, -6.029702733704988, -3.3621355700727813,
584
+ -2.4398021799003784, -2.828572331943788, -4.615812201097669,
585
+ -4.001175913627564, -3.7330292215533967, -5.40426456259918,
586
+ -5.257161328281758, -6.261426152508724, -4.535194787944865,
587
+ -4.145510245988851, -5.72971234213412, -6.207389620676681,
588
+ -6.446277631835302, -6.546024764300463, -6.893563869442234,
589
+ -7.090597533522821, -6.8651999922870175, -6.3051272471706845,
590
+ -6.706640782174993, -4.302815288748184, -5.05887320896379,
591
+ ],
592
+ ],
593
+ 'thresh': 0.0182,
594
+ // v2 logistic regression weights: [bias, w_bigramProb, w_entropy, w_hexRatio, w_vowelRatio, w_transitions, threshold]
595
+ // Trained on 4000000 strings. Test metrics: P=0.8939, R=0.9912, F1=0.9401
596
+ 'classifierWeights': [
597
+ 5.583716, -185.074346, -0.487557, 2.255307, -1.097614, 4.18453, 0.8,
598
+ ],
599
+ };
@@ -0,0 +1,18 @@
1
+ /**
2
+ * WhoTracks.Me
3
+ * https://whotracks.me/
4
+ *
5
+ * Copyright 2017-present Ghostery GmbH. All rights reserved.
6
+ *
7
+ * This Source Code Form is subject to the terms of the Mozilla Public
8
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
9
+ * file, You can obtain one at http://mozilla.org/MPL/2.0
10
+ */
11
+
12
+ import { HashProb } from './hash-detector-v2/index';
13
+
14
+ const classifier = new HashProb();
15
+
16
+ export function isHash(str) {
17
+ return classifier.isHash(str);
18
+ }
@@ -0,0 +1,43 @@
1
+ /**
2
+ * WhoTracks.Me
3
+ * https://whotracks.me/
4
+ *
5
+ * Copyright 2017-present Ghostery GmbH. All rights reserved.
6
+ *
7
+ * This Source Code Form is subject to the terms of the Mozilla Public
8
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
9
+ * file, You can obtain one at http://mozilla.org/MPL/2.0
10
+ */
11
+
12
+ import logger from './logger';
13
+
14
+ export default class Observable {
15
+ observers = [];
16
+
17
+ addObserver(observer) {
18
+ if (this.observers.includes(observer)) {
19
+ logger.warn('Observer already connected. Ignoring double subscription.');
20
+ } else {
21
+ this.observers.push(observer);
22
+ }
23
+ }
24
+
25
+ removeObserver(observer) {
26
+ const index = this.observers.indexOf(observer);
27
+ if (index === -1) {
28
+ logger.warn('Observer not connected. Cannot unsubscribe.');
29
+ } else {
30
+ this.observers.splice(index, 1);
31
+ }
32
+ }
33
+
34
+ notifyObservers(...args) {
35
+ this.observers.forEach((cb) => {
36
+ try {
37
+ cb(...args);
38
+ } catch (e) {
39
+ logger.warn('Ignore error in handler', e);
40
+ }
41
+ });
42
+ }
43
+ }