@splitsoftware/splitio-commons 0.1.1-canary.9 → 0.1.1-rc.18

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 (254) hide show
  1. package/cjs/evaluator/matchers/matcherTypes.js +4 -4
  2. package/cjs/evaluator/matchersTransform/index.js +11 -11
  3. package/cjs/evaluator/value/sanitize.js +6 -6
  4. package/cjs/listeners/browser.js +1 -2
  5. package/cjs/listeners/node.js +0 -3
  6. package/cjs/logger/constants.js +3 -1
  7. package/cjs/logger/messages/error.js +3 -2
  8. package/cjs/logger/messages/info.js +2 -2
  9. package/cjs/logger/messages/warn.js +2 -1
  10. package/cjs/readiness/readinessManager.js +10 -7
  11. package/cjs/sdkFactory/index.js +1 -4
  12. package/cjs/services/splitApi.js +1 -1
  13. package/cjs/services/splitHttpClient.js +5 -4
  14. package/cjs/storages/AbstractSplitsCacheSync.js +1 -1
  15. package/cjs/storages/inLocalStorage/index.js +5 -2
  16. package/cjs/storages/inMemory/InMemoryStorage.js +2 -0
  17. package/cjs/storages/inMemory/InMemoryStorageCS.js +2 -0
  18. package/cjs/storages/inRedis/SplitsCacheInRedis.js +6 -2
  19. package/cjs/storages/inRedis/index.js +5 -2
  20. package/cjs/storages/pluggable/SplitsCachePluggable.js +6 -2
  21. package/cjs/storages/pluggable/inMemoryWrapper.js +6 -7
  22. package/cjs/storages/pluggable/index.js +5 -2
  23. package/cjs/storages/pluggable/wrapperAdapter.js +0 -1
  24. package/cjs/sync/offline/splitsParser/splitsParserFromFile.js +92 -89
  25. package/cjs/sync/offline/splitsParser/splitsParserFromSettings.js +45 -42
  26. package/cjs/sync/offline/syncTasks/fromObjectSyncTask.js +14 -4
  27. package/cjs/sync/polling/updaters/mySegmentsUpdater.js +30 -10
  28. package/cjs/sync/streaming/SSEClient/index.js +0 -11
  29. package/cjs/sync/streaming/SSEHandler/NotificationKeeper.js +7 -0
  30. package/cjs/sync/streaming/SSEHandler/NotificationParser.js +4 -1
  31. package/cjs/sync/streaming/SSEHandler/index.js +8 -9
  32. package/cjs/sync/streaming/SSEHandler/types.js +14 -0
  33. package/cjs/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.js +5 -5
  34. package/cjs/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.js +2 -1
  35. package/cjs/sync/streaming/UpdateWorkers/SplitsUpdateWorker.js +5 -3
  36. package/cjs/sync/streaming/constants.js +3 -1
  37. package/cjs/sync/streaming/mySegmentsV2utils.js +75 -0
  38. package/cjs/sync/streaming/pushManager.js +141 -40
  39. package/cjs/sync/submitters/metricsSyncTask.js +1 -1
  40. package/cjs/sync/submitters/submitterSyncTask.js +2 -2
  41. package/cjs/sync/syncManagerFromFile.js +15 -0
  42. package/cjs/sync/syncManagerFromObject.js +14 -0
  43. package/cjs/sync/syncManagerOffline.js +3 -3
  44. package/cjs/sync/syncManagerOnline.js +5 -3
  45. package/cjs/trackers/impressionObserver/ImpressionObserver.js +0 -2
  46. package/cjs/trackers/impressionObserver/buildKey.js +3 -9
  47. package/cjs/trackers/impressionObserver/impressionObserverCS.js +2 -2
  48. package/cjs/trackers/impressionObserver/impressionObserverSS.js +3 -3
  49. package/cjs/utils/constants/index.js +4 -1
  50. package/cjs/utils/decompress/index.js +427 -0
  51. package/cjs/utils/murmur3/{commons.js → common.js} +2 -6
  52. package/cjs/utils/murmur3/murmur3.js +11 -12
  53. package/cjs/utils/murmur3/murmur3_128.js +7 -142
  54. package/cjs/utils/murmur3/murmur3_128_x86.js +154 -0
  55. package/cjs/utils/murmur3/murmur3_64.js +36 -0
  56. package/cjs/utils/murmur3/utfx.js +100 -106
  57. package/cjs/utils/promise/wrapper.js +14 -11
  58. package/cjs/utils/settingsValidation/index.js +5 -2
  59. package/cjs/utils/settingsValidation/localhost/index.js +20 -0
  60. package/cjs/utils/settingsValidation/splitFilters.js +0 -1
  61. package/cjs/utils/settingsValidation/storage/storageCS.js +18 -8
  62. package/cjs/utils/settingsValidation/url.js +1 -1
  63. package/esm/evaluator/matchers/matcherTypes.js +2 -2
  64. package/esm/evaluator/matchersTransform/index.js +12 -12
  65. package/esm/evaluator/value/sanitize.js +7 -7
  66. package/esm/listeners/browser.js +1 -2
  67. package/esm/listeners/node.js +0 -3
  68. package/esm/logger/constants.js +2 -0
  69. package/esm/logger/messages/error.js +3 -2
  70. package/esm/logger/messages/info.js +2 -2
  71. package/esm/logger/messages/warn.js +2 -1
  72. package/esm/readiness/readinessManager.js +10 -7
  73. package/esm/sdkFactory/index.js +1 -4
  74. package/esm/services/splitApi.js +1 -1
  75. package/esm/services/splitHttpClient.js +5 -4
  76. package/esm/storages/AbstractSplitsCacheSync.js +1 -1
  77. package/esm/storages/inLocalStorage/index.js +5 -2
  78. package/esm/storages/inMemory/InMemoryStorage.js +2 -0
  79. package/esm/storages/inMemory/InMemoryStorageCS.js +2 -0
  80. package/esm/storages/inRedis/SplitsCacheInRedis.js +6 -2
  81. package/esm/storages/inRedis/index.js +5 -2
  82. package/esm/storages/pluggable/SplitsCachePluggable.js +6 -2
  83. package/esm/storages/pluggable/inMemoryWrapper.js +6 -7
  84. package/esm/storages/pluggable/index.js +5 -2
  85. package/esm/storages/pluggable/wrapperAdapter.js +0 -1
  86. package/esm/sync/offline/splitsParser/splitsParserFromFile.js +90 -88
  87. package/esm/sync/offline/splitsParser/splitsParserFromSettings.js +43 -41
  88. package/esm/sync/offline/syncTasks/fromObjectSyncTask.js +15 -5
  89. package/esm/sync/polling/updaters/mySegmentsUpdater.js +30 -10
  90. package/esm/sync/streaming/SSEClient/index.js +0 -11
  91. package/esm/sync/streaming/SSEHandler/NotificationKeeper.js +7 -0
  92. package/esm/sync/streaming/SSEHandler/NotificationParser.js +4 -1
  93. package/esm/sync/streaming/SSEHandler/index.js +9 -10
  94. package/esm/sync/streaming/SSEHandler/types.js +13 -1
  95. package/esm/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.js +5 -5
  96. package/esm/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.js +2 -1
  97. package/esm/sync/streaming/UpdateWorkers/SplitsUpdateWorker.js +5 -3
  98. package/esm/sync/streaming/constants.js +2 -0
  99. package/esm/sync/streaming/mySegmentsV2utils.js +69 -0
  100. package/esm/sync/streaming/pushManager.js +143 -42
  101. package/esm/sync/submitters/metricsSyncTask.js +1 -1
  102. package/esm/sync/submitters/submitterSyncTask.js +2 -2
  103. package/esm/sync/syncManagerFromFile.js +11 -0
  104. package/esm/sync/syncManagerFromObject.js +10 -0
  105. package/esm/sync/syncManagerOffline.js +3 -3
  106. package/esm/sync/syncManagerOnline.js +5 -3
  107. package/esm/trackers/impressionObserver/ImpressionObserver.js +0 -2
  108. package/esm/trackers/impressionObserver/buildKey.js +2 -9
  109. package/esm/trackers/impressionObserver/impressionObserverCS.js +2 -2
  110. package/esm/trackers/impressionObserver/impressionObserverSS.js +3 -3
  111. package/esm/utils/constants/index.js +3 -0
  112. package/esm/utils/decompress/index.js +424 -0
  113. package/esm/utils/murmur3/{commons.js → common.js} +1 -4
  114. package/esm/utils/murmur3/murmur3.js +1 -2
  115. package/esm/utils/murmur3/murmur3_128.js +7 -142
  116. package/esm/utils/murmur3/murmur3_128_x86.js +150 -0
  117. package/esm/utils/murmur3/murmur3_64.js +32 -0
  118. package/esm/utils/murmur3/utfx.js +96 -106
  119. package/esm/utils/promise/wrapper.js +14 -11
  120. package/esm/utils/settingsValidation/index.js +5 -2
  121. package/esm/utils/settingsValidation/localhost/index.js +16 -0
  122. package/esm/utils/settingsValidation/splitFilters.js +0 -1
  123. package/esm/utils/settingsValidation/storage/storageCS.js +16 -7
  124. package/esm/utils/settingsValidation/url.js +1 -1
  125. package/package.json +5 -5
  126. package/src/evaluator/matchers/matcherTypes.ts +2 -2
  127. package/src/evaluator/matchersTransform/index.ts +12 -12
  128. package/src/evaluator/value/sanitize.ts +7 -7
  129. package/src/listeners/browser.ts +1 -1
  130. package/src/listeners/node.ts +1 -2
  131. package/src/logger/constants.ts +2 -0
  132. package/src/logger/messages/error.ts +3 -2
  133. package/src/logger/messages/info.ts +2 -2
  134. package/src/logger/messages/warn.ts +3 -1
  135. package/src/readiness/readinessManager.ts +9 -7
  136. package/src/sdkFactory/index.ts +1 -3
  137. package/src/sdkFactory/types.ts +3 -3
  138. package/src/services/splitApi.ts +2 -3
  139. package/src/services/splitHttpClient.ts +6 -5
  140. package/src/services/types.ts +5 -5
  141. package/src/storages/AbstractSplitsCacheSync.ts +1 -1
  142. package/src/storages/inLocalStorage/index.ts +8 -4
  143. package/src/storages/inMemory/InMemoryStorage.ts +3 -0
  144. package/src/storages/inMemory/InMemoryStorageCS.ts +3 -0
  145. package/src/storages/inRedis/SplitsCacheInRedis.ts +3 -1
  146. package/src/storages/inRedis/index.ts +8 -4
  147. package/src/storages/pluggable/SplitsCachePluggable.ts +3 -1
  148. package/src/storages/pluggable/inMemoryWrapper.ts +6 -7
  149. package/src/storages/pluggable/index.ts +8 -4
  150. package/src/storages/pluggable/wrapperAdapter.ts +0 -1
  151. package/src/storages/types.ts +18 -15
  152. package/src/sync/offline/splitsParser/splitsParserFromFile.ts +110 -105
  153. package/src/sync/offline/splitsParser/splitsParserFromSettings.ts +45 -41
  154. package/src/sync/offline/syncTasks/fromObjectSyncTask.ts +15 -5
  155. package/src/sync/polling/types.ts +2 -1
  156. package/src/sync/polling/updaters/mySegmentsUpdater.ts +28 -10
  157. package/src/sync/streaming/AuthClient/types.ts +3 -0
  158. package/src/sync/streaming/SSEClient/index.ts +1 -15
  159. package/src/sync/streaming/SSEClient/types.ts +0 -1
  160. package/src/sync/streaming/SSEHandler/NotificationKeeper.ts +8 -0
  161. package/src/sync/streaming/SSEHandler/NotificationParser.ts +4 -2
  162. package/src/sync/streaming/SSEHandler/index.ts +11 -20
  163. package/src/sync/streaming/SSEHandler/types.ts +37 -3
  164. package/src/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.ts +7 -6
  165. package/src/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.ts +2 -1
  166. package/src/sync/streaming/UpdateWorkers/SplitsUpdateWorker.ts +4 -3
  167. package/src/sync/streaming/UpdateWorkers/types.ts +1 -1
  168. package/src/sync/streaming/constants.ts +2 -0
  169. package/src/sync/streaming/mySegmentsV2utils.ts +77 -0
  170. package/src/sync/streaming/pushManager.ts +139 -42
  171. package/src/sync/streaming/types.ts +14 -22
  172. package/src/sync/submitters/metricsSyncTask.ts +1 -1
  173. package/src/sync/submitters/submitterSyncTask.ts +2 -1
  174. package/src/sync/syncManagerFromFile.ts +13 -0
  175. package/src/sync/syncManagerFromObject.ts +12 -0
  176. package/src/sync/syncManagerOffline.ts +3 -3
  177. package/src/sync/syncManagerOnline.ts +6 -3
  178. package/src/trackers/impressionObserver/ImpressionObserver.ts +4 -6
  179. package/src/trackers/impressionObserver/buildKey.ts +2 -16
  180. package/src/trackers/impressionObserver/impressionObserverCS.ts +2 -2
  181. package/src/trackers/impressionObserver/impressionObserverSS.ts +3 -3
  182. package/src/types.ts +16 -2
  183. package/src/utils/constants/index.ts +6 -1
  184. package/src/utils/decompress/index.ts +429 -0
  185. package/src/utils/murmur3/{commons.ts → common.ts} +1 -5
  186. package/src/utils/murmur3/murmur3.ts +5 -5
  187. package/src/utils/murmur3/murmur3_128.ts +7 -180
  188. package/src/utils/murmur3/murmur3_128_x86.ts +188 -0
  189. package/src/utils/murmur3/murmur3_64.ts +36 -0
  190. package/src/utils/murmur3/utfx.ts +92 -110
  191. package/src/utils/promise/wrapper.ts +12 -9
  192. package/src/utils/settingsValidation/index.ts +8 -4
  193. package/src/utils/settingsValidation/localhost/index.ts +19 -0
  194. package/src/utils/settingsValidation/splitFilters.ts +0 -1
  195. package/src/utils/settingsValidation/storage/storageCS.ts +21 -8
  196. package/src/utils/settingsValidation/types.ts +2 -11
  197. package/src/utils/settingsValidation/url.ts +1 -1
  198. package/types/evaluator/matchers/matcherTypes.d.ts +2 -2
  199. package/types/listeners/browser.d.ts +1 -0
  200. package/types/listeners/node.d.ts +0 -1
  201. package/types/logger/constants.d.ts +2 -0
  202. package/types/sdkFactory/types.d.ts +3 -3
  203. package/types/services/types.d.ts +1 -0
  204. package/types/storages/inLocalStorage/index.d.ts +2 -2
  205. package/types/storages/inMemory/InMemoryStorage.d.ts +3 -0
  206. package/types/storages/inMemory/InMemoryStorageCS.d.ts +3 -0
  207. package/types/storages/inRedis/index.d.ts +2 -2
  208. package/types/storages/pluggable/index.d.ts +2 -2
  209. package/types/storages/types.d.ts +15 -15
  210. package/types/sync/offline/splitsParser/splitsParserFromFile.d.ts +2 -7
  211. package/types/sync/offline/splitsParser/splitsParserFromSettings.d.ts +1 -5
  212. package/types/sync/polling/types.d.ts +2 -1
  213. package/types/sync/streaming/AuthClient/indexV1.d.ts +12 -0
  214. package/types/sync/streaming/AuthClient/indexV2.d.ts +8 -0
  215. package/types/sync/streaming/AuthClient/types.d.ts +2 -0
  216. package/types/sync/streaming/SSEClient/index.d.ts +1 -9
  217. package/types/sync/streaming/SSEClient/types.d.ts +0 -1
  218. package/types/sync/streaming/SSEHandler/NotificationParser.d.ts +3 -2
  219. package/types/sync/streaming/SSEHandler/types.d.ts +30 -2
  220. package/types/sync/streaming/UpdateWorkers/MySegmentsUpdateWorker.d.ts +4 -3
  221. package/types/sync/streaming/UpdateWorkers/SegmentsUpdateWorker.d.ts +2 -1
  222. package/types/sync/streaming/UpdateWorkers/SplitsUpdateWorker.d.ts +3 -2
  223. package/types/sync/streaming/UpdateWorkers/types.d.ts +1 -1
  224. package/types/sync/streaming/constants.d.ts +3 -1
  225. package/types/sync/streaming/mySegmentsV2utils.d.ts +27 -0
  226. package/types/sync/streaming/pushManagerNoUsers.d.ts +13 -0
  227. package/types/sync/streaming/types.d.ts +9 -5
  228. package/types/sync/submitters/submitterSyncTask.d.ts +1 -1
  229. package/types/sync/syncManagerFromFile.d.ts +2 -0
  230. package/types/sync/syncManagerFromObject.d.ts +2 -0
  231. package/types/sync/syncManagerOffline.d.ts +1 -1
  232. package/types/trackers/impressionObserver/ImpressionObserver.d.ts +2 -2
  233. package/types/trackers/impressionObserver/buildKey.d.ts +1 -1
  234. package/types/trackers/impressionObserver/impressionObserverCS.d.ts +2 -2
  235. package/types/trackers/impressionObserver/impressionObserverSS.d.ts +2 -2
  236. package/types/types.d.ts +16 -2
  237. package/types/utils/constants/index.d.ts +5 -1
  238. package/types/utils/decompress/index.d.ts +16 -0
  239. package/types/utils/murmur3/common.d.ts +12 -0
  240. package/types/utils/murmur3/murmur3.d.ts +2 -2
  241. package/types/utils/murmur3/murmur3_128.d.ts +5 -0
  242. package/types/utils/murmur3/murmur3_128_x86.d.ts +7 -0
  243. package/types/utils/murmur3/murmur3_64.d.ts +10 -0
  244. package/types/utils/murmur3/utfx.d.ts +24 -6
  245. package/types/utils/settingsValidation/index.d.ts +3 -2
  246. package/types/utils/settingsValidation/localhost/index.d.ts +9 -0
  247. package/types/utils/settingsValidation/storage/storageCS.d.ts +7 -1
  248. package/types/utils/settingsValidation/types.d.ts +2 -10
  249. package/cjs/sync/streaming/pushManagerCS.js +0 -179
  250. package/cjs/sync/streaming/pushManagerSS.js +0 -128
  251. package/esm/sync/streaming/pushManagerCS.js +0 -175
  252. package/esm/sync/streaming/pushManagerSS.js +0 -124
  253. package/src/sync/streaming/pushManagerCS.ts +0 -238
  254. package/src/sync/streaming/pushManagerSS.ts +0 -177
@@ -0,0 +1,427 @@
1
+ "use strict";
2
+ /*
3
+ Trimmed version of "fflate" library (https://www.npmjs.com/package/fflate/v/0.7.1)
4
+ used for GZIP/Zlib decompression in JavaScript, with the minimal modules used by the SDK.
5
+
6
+ MIT License
7
+
8
+ Copyright (c) 2020 Arjun Barrett
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+ */
28
+ /* eslint-disable */
29
+ // @ts-nocheck
30
+ Object.defineProperty(exports, "__esModule", { value: true });
31
+ exports.algorithms = void 0;
32
+ exports.algorithms = (function iifeDecompress() {
33
+ // Handle runtimes without typed arrays
34
+ if ([typeof Uint8Array, typeof Uint16Array, typeof Uint32Array].some(function (v) { return v != 'function'; })) {
35
+ return 'global Uint8Array object is not available for gzip/zlib decompression';
36
+ }
37
+ // DEFLATE is a complex format; to read this code, you should probably check the RFC first:
38
+ // aliases for shorter compressed code (most minifers don't do this)
39
+ var u8 = Uint8Array, u16 = Uint16Array, u32 = Uint32Array;
40
+ // fixed length extra bits
41
+ var fleb = new u8([0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, /* unused */ 0, 0, /* impossible */ 0]);
42
+ // fixed distance extra bits
43
+ // see fleb note
44
+ var fdeb = new u8([0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, /* unused */ 0, 0]);
45
+ // code length index map
46
+ var clim = new u8([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]);
47
+ // get base, reverse index map from extra bits
48
+ var freb = function (eb, start) {
49
+ var b = new u16(31);
50
+ for (var i = 0; i < 31; ++i) {
51
+ b[i] = start += 1 << eb[i - 1];
52
+ }
53
+ // numbers here are at max 18 bits
54
+ var r = new u32(b[30]);
55
+ for (var i = 1; i < 30; ++i) {
56
+ for (var j = b[i]; j < b[i + 1]; ++j) {
57
+ r[j] = ((j - b[i]) << 5) | i;
58
+ }
59
+ }
60
+ return [b, r];
61
+ };
62
+ var _a = freb(fleb, 2), fl = _a[0], revfl = _a[1];
63
+ // we can ignore the fact that the other numbers are wrong; they never happen anyway
64
+ fl[28] = 258, revfl[258] = 28;
65
+ var _b = freb(fdeb, 0), fd = _b[0];
66
+ // map of value to reverse (assuming 16 bits)
67
+ var rev = new u16(32768);
68
+ for (var i = 0; i < 32768; ++i) {
69
+ // reverse table algorithm from SO
70
+ var x = ((i & 0xAAAA) >>> 1) | ((i & 0x5555) << 1);
71
+ x = ((x & 0xCCCC) >>> 2) | ((x & 0x3333) << 2);
72
+ x = ((x & 0xF0F0) >>> 4) | ((x & 0x0F0F) << 4);
73
+ rev[i] = (((x & 0xFF00) >>> 8) | ((x & 0x00FF) << 8)) >>> 1;
74
+ }
75
+ // create huffman tree from u8 "map": index -> code length for code index
76
+ // mb (max bits) must be at most 15
77
+ // TODO: optimize/split up?
78
+ var hMap = (function (cd, mb, r) {
79
+ var s = cd.length;
80
+ // index
81
+ var i = 0;
82
+ // u16 "map": index -> # of codes with bit length = index
83
+ var l = new u16(mb);
84
+ // length of cd must be 288 (total # of codes)
85
+ for (; i < s; ++i)
86
+ ++l[cd[i] - 1];
87
+ // u16 "map": index -> minimum code for bit length = index
88
+ var le = new u16(mb);
89
+ for (i = 0; i < mb; ++i) {
90
+ le[i] = (le[i - 1] + l[i - 1]) << 1;
91
+ }
92
+ var co;
93
+ if (r) {
94
+ // u16 "map": index -> number of actual bits, symbol for code
95
+ co = new u16(1 << mb);
96
+ // bits to remove for reverser
97
+ var rvb = 15 - mb;
98
+ for (i = 0; i < s; ++i) {
99
+ // ignore 0 lengths
100
+ if (cd[i]) {
101
+ // num encoding both symbol and bits read
102
+ var sv = (i << 4) | cd[i];
103
+ // free bits
104
+ var r_1 = mb - cd[i];
105
+ // start value
106
+ var v = le[cd[i] - 1]++ << r_1;
107
+ // m is end value
108
+ for (var m = v | ((1 << r_1) - 1); v <= m; ++v) {
109
+ // every 16 bit value starting with the code yields the same result
110
+ co[rev[v] >>> rvb] = sv;
111
+ }
112
+ }
113
+ }
114
+ }
115
+ else {
116
+ co = new u16(s);
117
+ for (i = 0; i < s; ++i) {
118
+ if (cd[i]) {
119
+ co[i] = rev[le[cd[i] - 1]++] >>> (15 - cd[i]);
120
+ }
121
+ }
122
+ }
123
+ return co;
124
+ });
125
+ // fixed length tree
126
+ var flt = new u8(288);
127
+ for (var i = 0; i < 144; ++i)
128
+ flt[i] = 8;
129
+ for (var i = 144; i < 256; ++i)
130
+ flt[i] = 9;
131
+ for (var i = 256; i < 280; ++i)
132
+ flt[i] = 7;
133
+ for (var i = 280; i < 288; ++i)
134
+ flt[i] = 8;
135
+ // fixed distance tree
136
+ var fdt = new u8(32);
137
+ for (var i = 0; i < 32; ++i)
138
+ fdt[i] = 5;
139
+ // fixed length map
140
+ var flrm = /*#__PURE__*/ hMap(flt, 9, 1);
141
+ // fixed distance map
142
+ var fdrm = /*#__PURE__*/ hMap(fdt, 5, 1);
143
+ // find max of array
144
+ var max = function (a) {
145
+ var m = a[0];
146
+ for (var i = 1; i < a.length; ++i) {
147
+ if (a[i] > m)
148
+ m = a[i];
149
+ }
150
+ return m;
151
+ };
152
+ // read d, starting at bit p and mask with m
153
+ var bits = function (d, p, m) {
154
+ var o = (p / 8) | 0;
155
+ return ((d[o] | (d[o + 1] << 8)) >> (p & 7)) & m;
156
+ };
157
+ // read d, starting at bit p continuing for at least 16 bits
158
+ var bits16 = function (d, p) {
159
+ var o = (p / 8) | 0;
160
+ return ((d[o] | (d[o + 1] << 8) | (d[o + 2] << 16)) >> (p & 7));
161
+ };
162
+ // get end of byte
163
+ var shft = function (p) { return ((p + 7) / 8) | 0; };
164
+ // typed array slice - allows garbage collector to free original reference,
165
+ // while being more compatible than .slice
166
+ var slc = function (v, s, e) {
167
+ if (s == null || s < 0)
168
+ s = 0;
169
+ if (e == null || e > v.length)
170
+ e = v.length;
171
+ // can't use .constructor in case user-supplied
172
+ var n = new (v instanceof u16 ? u16 : v instanceof u32 ? u32 : u8)(e - s);
173
+ n.set(v.subarray(s, e));
174
+ return n;
175
+ };
176
+ // error codes
177
+ var ec = [
178
+ 'unexpected EOF',
179
+ 'invalid block type',
180
+ 'invalid length/literal',
181
+ 'invalid distance',
182
+ 'stream finished',
183
+ 'no stream handler',
184
+ ,
185
+ 'no callback',
186
+ 'invalid UTF-8 data',
187
+ 'extra field too long',
188
+ 'date not in range 1980-2099',
189
+ 'filename too long',
190
+ 'stream finishing',
191
+ 'invalid zip data'
192
+ // determined by unknown compression method
193
+ ];
194
+ var err = function (ind, msg, nt) {
195
+ var e = new Error(msg || ec[ind]);
196
+ e.code = ind;
197
+ if (Error.captureStackTrace)
198
+ Error.captureStackTrace(e, err);
199
+ if (!nt)
200
+ throw e;
201
+ return e;
202
+ };
203
+ // expands raw DEFLATE data
204
+ var inflt = function (dat, buf, st) {
205
+ // source length
206
+ var sl = dat.length;
207
+ if (!sl || (st && st.f && !st.l))
208
+ return buf || new u8(0);
209
+ // have to estimate size
210
+ var noBuf = !buf || st;
211
+ // no state
212
+ var noSt = !st || st.i;
213
+ if (!st)
214
+ st = {};
215
+ // Assumes roughly 33% compression ratio average
216
+ if (!buf)
217
+ buf = new u8(sl * 3);
218
+ // ensure buffer can fit at least l elements
219
+ var cbuf = function (l) {
220
+ var bl = buf.length;
221
+ // need to increase size to fit
222
+ if (l > bl) {
223
+ // Double or set to necessary, whichever is greater
224
+ var nbuf = new u8(Math.max(bl * 2, l));
225
+ nbuf.set(buf);
226
+ buf = nbuf;
227
+ }
228
+ };
229
+ // last chunk bitpos bytes
230
+ var final = st.f || 0, pos = st.p || 0, bt = st.b || 0, lm = st.l, dm = st.d, lbt = st.m, dbt = st.n;
231
+ // total bits
232
+ var tbts = sl * 8;
233
+ do {
234
+ if (!lm) {
235
+ // BFINAL - this is only 1 when last chunk is next
236
+ final = bits(dat, pos, 1);
237
+ // type: 0 = no compression, 1 = fixed huffman, 2 = dynamic huffman
238
+ var type = bits(dat, pos + 1, 3);
239
+ pos += 3;
240
+ if (!type) {
241
+ // go to end of byte boundary
242
+ var s = shft(pos) + 4, l = dat[s - 4] | (dat[s - 3] << 8), t = s + l;
243
+ if (t > sl) {
244
+ if (noSt)
245
+ err(0);
246
+ break;
247
+ }
248
+ // ensure size
249
+ if (noBuf)
250
+ cbuf(bt + l);
251
+ // Copy over uncompressed data
252
+ buf.set(dat.subarray(s, t), bt);
253
+ // Get new bitpos, update byte count
254
+ st.b = bt += l, st.p = pos = t * 8, st.f = final;
255
+ continue;
256
+ }
257
+ else if (type == 1)
258
+ lm = flrm, dm = fdrm, lbt = 9, dbt = 5;
259
+ else if (type == 2) {
260
+ // literal lengths
261
+ var hLit = bits(dat, pos, 31) + 257, hcLen = bits(dat, pos + 10, 15) + 4;
262
+ var tl = hLit + bits(dat, pos + 5, 31) + 1;
263
+ pos += 14;
264
+ // length+distance tree
265
+ var ldt = new u8(tl);
266
+ // code length tree
267
+ var clt = new u8(19);
268
+ for (var i = 0; i < hcLen; ++i) {
269
+ // use index map to get real code
270
+ clt[clim[i]] = bits(dat, pos + i * 3, 7);
271
+ }
272
+ pos += hcLen * 3;
273
+ // code lengths bits
274
+ var clb = max(clt), clbmsk = (1 << clb) - 1;
275
+ // code lengths map
276
+ var clm = hMap(clt, clb, 1);
277
+ for (var i = 0; i < tl;) {
278
+ var r = clm[bits(dat, pos, clbmsk)];
279
+ // bits read
280
+ pos += r & 15;
281
+ // symbol
282
+ var s = r >>> 4;
283
+ // code length to copy
284
+ if (s < 16) {
285
+ ldt[i++] = s;
286
+ }
287
+ else {
288
+ // copy count
289
+ var c = 0, n = 0;
290
+ if (s == 16)
291
+ n = 3 + bits(dat, pos, 3), pos += 2, c = ldt[i - 1];
292
+ else if (s == 17)
293
+ n = 3 + bits(dat, pos, 7), pos += 3;
294
+ else if (s == 18)
295
+ n = 11 + bits(dat, pos, 127), pos += 7;
296
+ while (n--)
297
+ ldt[i++] = c;
298
+ }
299
+ }
300
+ // length tree distance tree
301
+ var lt = ldt.subarray(0, hLit), dt = ldt.subarray(hLit);
302
+ // max length bits
303
+ lbt = max(lt);
304
+ // max dist bits
305
+ dbt = max(dt);
306
+ lm = hMap(lt, lbt, 1);
307
+ dm = hMap(dt, dbt, 1);
308
+ }
309
+ else
310
+ err(1);
311
+ if (pos > tbts) {
312
+ if (noSt)
313
+ err(0);
314
+ break;
315
+ }
316
+ }
317
+ // Make sure the buffer can hold this + the largest possible addition
318
+ // Maximum chunk size (practically, theoretically infinite) is 2^17;
319
+ if (noBuf)
320
+ cbuf(bt + 131072);
321
+ var lms = (1 << lbt) - 1, dms = (1 << dbt) - 1;
322
+ var lpos = pos;
323
+ for (;; lpos = pos) {
324
+ // bits read, code
325
+ var c = lm[bits16(dat, pos) & lms], sym = c >>> 4;
326
+ pos += c & 15;
327
+ if (pos > tbts) {
328
+ if (noSt)
329
+ err(0);
330
+ break;
331
+ }
332
+ if (!c)
333
+ err(2);
334
+ if (sym < 256)
335
+ buf[bt++] = sym;
336
+ else if (sym == 256) {
337
+ lpos = pos, lm = null;
338
+ break;
339
+ }
340
+ else {
341
+ var add = sym - 254;
342
+ // no extra bits needed if less
343
+ if (sym > 264) {
344
+ // index
345
+ var i = sym - 257, b = fleb[i];
346
+ add = bits(dat, pos, (1 << b) - 1) + fl[i];
347
+ pos += b;
348
+ }
349
+ // dist
350
+ var d = dm[bits16(dat, pos) & dms], dsym = d >>> 4;
351
+ if (!d)
352
+ err(3);
353
+ pos += d & 15;
354
+ var dt = fd[dsym];
355
+ if (dsym > 3) {
356
+ var b = fdeb[dsym];
357
+ dt += bits16(dat, pos) & ((1 << b) - 1), pos += b;
358
+ }
359
+ if (pos > tbts) {
360
+ if (noSt)
361
+ err(0);
362
+ break;
363
+ }
364
+ if (noBuf)
365
+ cbuf(bt + 131072);
366
+ var end = bt + add;
367
+ for (; bt < end; bt += 4) {
368
+ buf[bt] = buf[bt - dt];
369
+ buf[bt + 1] = buf[bt + 1 - dt];
370
+ buf[bt + 2] = buf[bt + 2 - dt];
371
+ buf[bt + 3] = buf[bt + 3 - dt];
372
+ }
373
+ bt = end;
374
+ }
375
+ }
376
+ st.l = lm, st.p = lpos, st.b = bt, st.f = final;
377
+ if (lm)
378
+ final = 1, st.m = lbt, st.d = dm, st.n = dbt;
379
+ } while (!final);
380
+ return bt == buf.length ? buf : slc(buf, 0, bt);
381
+ };
382
+ // gzip footer: -8 to -4 = CRC, -4 to -0 is length
383
+ // gzip start
384
+ var gzs = function (d) {
385
+ if (d[0] != 31 || d[1] != 139 || d[2] != 8)
386
+ err(6, 'invalid gzip data');
387
+ var flg = d[3];
388
+ var st = 10;
389
+ if (flg & 4)
390
+ st += d[10] | (d[11] << 8) + 2;
391
+ for (var zs = (flg >> 3 & 1) + (flg >> 4 & 1); zs > 0; zs -= !d[st++])
392
+ ;
393
+ return st + (flg & 2);
394
+ };
395
+ // gzip length
396
+ var gzl = function (d) {
397
+ var l = d.length;
398
+ return ((d[l - 4] | d[l - 3] << 8 | d[l - 2] << 16) | (d[l - 1] << 24)) >>> 0;
399
+ };
400
+ // zlib valid
401
+ var zlv = function (d) {
402
+ if ((d[0] & 15) != 8 || (d[0] >>> 4) > 7 || ((d[0] << 8 | d[1]) % 31))
403
+ err(6, 'invalid zlib data');
404
+ if (d[1] & 32)
405
+ err(6, 'invalid zlib data: preset dictionaries not supported');
406
+ };
407
+ return {
408
+ /**
409
+ * Expands GZIP data
410
+ * @param data The data to decompress
411
+ * @param out Where to write the data. GZIP already encodes the output size, so providing this doesn't save memory.
412
+ * @returns The decompressed version of the data
413
+ */
414
+ gunzipSync: function (data, out) {
415
+ return inflt(data.subarray(gzs(data), -8), out || new u8(gzl(data)));
416
+ },
417
+ /**
418
+ * Expands Zlib data
419
+ * @param data The data to decompress
420
+ * @param out Where to write the data. Saves memory if you know the decompressed size and provide an output buffer of that length.
421
+ * @returns The decompressed version of the data
422
+ */
423
+ unzlibSync: function (data, out) {
424
+ return inflt((zlv(data), data.subarray(2, -4)), out);
425
+ }
426
+ };
427
+ })();
@@ -1,14 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.x86Fmix = exports.x86Rotl = exports.x86Multiply = exports.UTF16ToUTF8 = void 0;
4
- var tslib_1 = require("tslib");
5
- var utfx_1 = tslib_1.__importDefault(require("./utfx"));
6
- var stringSource = utfx_1.default.stringSource;
7
- var stringDestination = utfx_1.default.stringDestination;
8
- var encodeUTF16toUTF8 = utfx_1.default.encodeUTF16toUTF8;
4
+ var utfx_1 = require("./utfx");
9
5
  function UTF16ToUTF8(key) {
10
6
  var sd;
11
- encodeUTF16toUTF8(stringSource(key), sd = stringDestination());
7
+ utfx_1.encodeUTF16toUTF8(utfx_1.stringSource(key), sd = utfx_1.stringDestination());
12
8
  return sd();
13
9
  }
14
10
  exports.UTF16ToUTF8 = UTF16ToUTF8;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.bucket = exports.hash = void 0;
4
4
  /* eslint-disable no-fallthrough */
5
- var commons_1 = require("./commons");
5
+ var common_1 = require("./common");
6
6
  /*
7
7
  * +----------------------------------------------------------------------------------+
8
8
  * | murmurHash3.js v3.0.0 (http://github.com/karanlyons/murmurHash3.js) |
@@ -28,12 +28,12 @@ function hash32(key, seed) {
28
28
  var c2 = 0x1b873593;
29
29
  for (var i = 0; i < bytes; i = i + 4) {
30
30
  k1 = ((key.charCodeAt(i) & 0xff)) | ((key.charCodeAt(i + 1) & 0xff) << 8) | ((key.charCodeAt(i + 2) & 0xff) << 16) | ((key.charCodeAt(i + 3) & 0xff) << 24);
31
- k1 = commons_1.x86Multiply(k1, c1);
32
- k1 = commons_1.x86Rotl(k1, 15);
33
- k1 = commons_1.x86Multiply(k1, c2);
31
+ k1 = common_1.x86Multiply(k1, c1);
32
+ k1 = common_1.x86Rotl(k1, 15);
33
+ k1 = common_1.x86Multiply(k1, c2);
34
34
  h1 ^= k1;
35
- h1 = commons_1.x86Rotl(h1, 13);
36
- h1 = commons_1.x86Multiply(h1, 5) + 0xe6546b64;
35
+ h1 = common_1.x86Rotl(h1, 13);
36
+ h1 = common_1.x86Multiply(h1, 5) + 0xe6546b64;
37
37
  }
38
38
  k1 = 0;
39
39
  switch (remainder) {
@@ -43,18 +43,17 @@ function hash32(key, seed) {
43
43
  k1 ^= (key.charCodeAt(i + 1) & 0xff) << 8;
44
44
  case 1:
45
45
  k1 ^= (key.charCodeAt(i) & 0xff);
46
- k1 = commons_1.x86Multiply(k1, c1);
47
- k1 = commons_1.x86Rotl(k1, 15);
48
- k1 = commons_1.x86Multiply(k1, c2);
46
+ k1 = common_1.x86Multiply(k1, c1);
47
+ k1 = common_1.x86Rotl(k1, 15);
48
+ k1 = common_1.x86Multiply(k1, c2);
49
49
  h1 ^= k1;
50
50
  }
51
51
  h1 ^= key.length;
52
- h1 = commons_1.x86Fmix(h1);
52
+ h1 = common_1.x86Fmix(h1);
53
53
  return h1 >>> 0;
54
54
  }
55
55
  function hash(str, seed) {
56
- // @ts-ignore
57
- return hash32(commons_1.UTF16ToUTF8(str), seed >>> 0);
56
+ return hash32(common_1.UTF16ToUTF8(str), seed >>> 0);
58
57
  }
59
58
  exports.hash = hash;
60
59
  function bucket(str, seed) {
@@ -2,11 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.hash128 = void 0;
4
4
  /* eslint-disable no-fallthrough */
5
- var commons_1 = require("./commons");
6
- var X64 = 'x64';
7
- var X86 = 'x86';
8
- var X64_ARCHS = ['arm64', 'ppc64', 'x64', 's390x', 'mipsel'];
9
- var isX64 = getArchType() === X64;
5
+ var common_1 = require("./common");
10
6
  /*
11
7
  * +----------------------------------------------------------------------------------+
12
8
  * | murmurHash3.js v3.0.0 (http://github.com/karanlyons/murmurHash3.js) |
@@ -125,135 +121,6 @@ function _x64Fmix(h) {
125
121
  }
126
122
  // PUBLIC FUNCTIONS
127
123
  // ----------------
128
- function hash128x86(key, seed) {
129
- //
130
- // Given a string and an optional seed as an int, returns a 128 bit
131
- // hash using the x86 flavor of MurmurHash3, as an unsigned hex.
132
- //
133
- key = key || '';
134
- seed = seed || 0;
135
- var remainder = key.length % 16;
136
- var bytes = key.length - remainder;
137
- var h1 = seed;
138
- var h2 = seed;
139
- var h3 = seed;
140
- var h4 = seed;
141
- var k1 = 0;
142
- var k2 = 0;
143
- var k3 = 0;
144
- var k4 = 0;
145
- var c1 = 0x239b961b;
146
- var c2 = 0xab0e9789;
147
- var c3 = 0x38b34ae5;
148
- var c4 = 0xa1e38b93;
149
- for (var i = 0; i < bytes; i = i + 16) {
150
- k1 = ((key.charCodeAt(i) & 0xff)) | ((key.charCodeAt(i + 1) & 0xff) << 8) | ((key.charCodeAt(i + 2) & 0xff) << 16) | ((key.charCodeAt(i + 3) & 0xff) << 24);
151
- k2 = ((key.charCodeAt(i + 4) & 0xff)) | ((key.charCodeAt(i + 5) & 0xff) << 8) | ((key.charCodeAt(i + 6) & 0xff) << 16) | ((key.charCodeAt(i + 7) & 0xff) << 24);
152
- k3 = ((key.charCodeAt(i + 8) & 0xff)) | ((key.charCodeAt(i + 9) & 0xff) << 8) | ((key.charCodeAt(i + 10) & 0xff) << 16) | ((key.charCodeAt(i + 11) & 0xff) << 24);
153
- k4 = ((key.charCodeAt(i + 12) & 0xff)) | ((key.charCodeAt(i + 13) & 0xff) << 8) | ((key.charCodeAt(i + 14) & 0xff) << 16) | ((key.charCodeAt(i + 15) & 0xff) << 24);
154
- k1 = commons_1.x86Multiply(k1, c1);
155
- k1 = commons_1.x86Rotl(k1, 15);
156
- k1 = commons_1.x86Multiply(k1, c2);
157
- h1 ^= k1;
158
- h1 = commons_1.x86Rotl(h1, 19);
159
- h1 += h2;
160
- h1 = commons_1.x86Multiply(h1, 5) + 0x561ccd1b;
161
- k2 = commons_1.x86Multiply(k2, c2);
162
- k2 = commons_1.x86Rotl(k2, 16);
163
- k2 = commons_1.x86Multiply(k2, c3);
164
- h2 ^= k2;
165
- h2 = commons_1.x86Rotl(h2, 17);
166
- h2 += h3;
167
- h2 = commons_1.x86Multiply(h2, 5) + 0x0bcaa747;
168
- k3 = commons_1.x86Multiply(k3, c3);
169
- k3 = commons_1.x86Rotl(k3, 17);
170
- k3 = commons_1.x86Multiply(k3, c4);
171
- h3 ^= k3;
172
- h3 = commons_1.x86Rotl(h3, 15);
173
- h3 += h4;
174
- h3 = commons_1.x86Multiply(h3, 5) + 0x96cd1c35;
175
- k4 = commons_1.x86Multiply(k4, c4);
176
- k4 = commons_1.x86Rotl(k4, 18);
177
- k4 = commons_1.x86Multiply(k4, c1);
178
- h4 ^= k4;
179
- h4 = commons_1.x86Rotl(h4, 13);
180
- h4 += h1;
181
- h4 = commons_1.x86Multiply(h4, 5) + 0x32ac3b17;
182
- }
183
- k1 = 0;
184
- k2 = 0;
185
- k3 = 0;
186
- k4 = 0;
187
- switch (remainder) {
188
- case 15:
189
- k4 ^= key.charCodeAt(i + 14) << 16;
190
- case 14:
191
- k4 ^= key.charCodeAt(i + 13) << 8;
192
- case 13:
193
- k4 ^= key.charCodeAt(i + 12);
194
- k4 = commons_1.x86Multiply(k4, c4);
195
- k4 = commons_1.x86Rotl(k4, 18);
196
- k4 = commons_1.x86Multiply(k4, c1);
197
- h4 ^= k4;
198
- case 12:
199
- k3 ^= key.charCodeAt(i + 11) << 24;
200
- case 11:
201
- k3 ^= key.charCodeAt(i + 10) << 16;
202
- case 10:
203
- k3 ^= key.charCodeAt(i + 9) << 8;
204
- case 9:
205
- k3 ^= key.charCodeAt(i + 8);
206
- k3 = commons_1.x86Multiply(k3, c3);
207
- k3 = commons_1.x86Rotl(k3, 17);
208
- k3 = commons_1.x86Multiply(k3, c4);
209
- h3 ^= k3;
210
- case 8:
211
- k2 ^= key.charCodeAt(i + 7) << 24;
212
- case 7:
213
- k2 ^= key.charCodeAt(i + 6) << 16;
214
- case 6:
215
- k2 ^= key.charCodeAt(i + 5) << 8;
216
- case 5:
217
- k2 ^= key.charCodeAt(i + 4);
218
- k2 = commons_1.x86Multiply(k2, c2);
219
- k2 = commons_1.x86Rotl(k2, 16);
220
- k2 = commons_1.x86Multiply(k2, c3);
221
- h2 ^= k2;
222
- case 4:
223
- k1 ^= key.charCodeAt(i + 3) << 24;
224
- case 3:
225
- k1 ^= key.charCodeAt(i + 2) << 16;
226
- case 2:
227
- k1 ^= key.charCodeAt(i + 1) << 8;
228
- case 1:
229
- k1 ^= key.charCodeAt(i);
230
- k1 = commons_1.x86Multiply(k1, c1);
231
- k1 = commons_1.x86Rotl(k1, 15);
232
- k1 = commons_1.x86Multiply(k1, c2);
233
- h1 ^= k1;
234
- }
235
- h1 ^= key.length;
236
- h2 ^= key.length;
237
- h3 ^= key.length;
238
- h4 ^= key.length;
239
- h1 += h2;
240
- h1 += h3;
241
- h1 += h4;
242
- h2 += h1;
243
- h3 += h1;
244
- h4 += h1;
245
- h1 = commons_1.x86Fmix(h1);
246
- h2 = commons_1.x86Fmix(h2);
247
- h3 = commons_1.x86Fmix(h3);
248
- h4 = commons_1.x86Fmix(h4);
249
- h1 += h2;
250
- h1 += h3;
251
- h1 += h4;
252
- h2 += h1;
253
- h3 += h1;
254
- h4 += h1;
255
- return ('00000000' + (h1 >>> 0).toString(16)).slice(-8) + ('00000000' + (h2 >>> 0).toString(16)).slice(-8) + ('00000000' + (h3 >>> 0).toString(16)).slice(-8) + ('00000000' + (h4 >>> 0).toString(16)).slice(-8);
256
- }
257
124
  function hash128x64(key, seed) {
258
125
  //
259
126
  // Given a string and an optional seed as an int, returns a 128 bit
@@ -341,14 +208,12 @@ function hash128x64(key, seed) {
341
208
  h2 = _x64Add(h2, h1);
342
209
  return ('00000000' + (h1[0] >>> 0).toString(16)).slice(-8) + ('00000000' + (h1[1] >>> 0).toString(16)).slice(-8) + ('00000000' + (h2[0] >>> 0).toString(16)).slice(-8) + ('00000000' + (h2[1] >>> 0).toString(16)).slice(-8);
343
210
  }
344
- function getArchType() {
345
- // Values listed from https://nodejs.org/api/process.html#process_process_arch
346
- // @TODO Review when supporting alternatives of Node
347
- // eslint-disable-next-line no-undef
348
- var arch = typeof process !== 'undefined' && process.arch ? process.arch : X86;
349
- return (X64_ARCHS.indexOf(arch) > -1) ? X64 : X86;
350
- }
211
+ /**
212
+ * x64 version of Murmur3 for 128bits.
213
+ *
214
+ * @param {string} str
215
+ */
351
216
  function hash128(str, seed) {
352
- return isX64 ? hash128x64(commons_1.UTF16ToUTF8(str), seed >>> 0) : hash128x86(commons_1.UTF16ToUTF8(str), seed >>> 0);
217
+ return hash128x64(common_1.UTF16ToUTF8(str), seed >>> 0);
353
218
  }
354
219
  exports.hash128 = hash128;