@nsshunt/stsfhirpg 1.2.20 → 1.2.21

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.
package/dist/index.cjs CHANGED
@@ -6,6 +6,7 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
6
  var __getOwnPropNames = Object.getOwnPropertyNames;
7
7
  var __getProtoOf = Object.getPrototypeOf;
8
8
  var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
9
10
  var __copyProps = (to, from, except, desc) => {
10
11
  if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
12
  key = keys[i];
@@ -22,7 +23,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
22
23
  }) : target, mod));
23
24
  //#endregion
24
25
  let luxon = require("luxon");
25
- let murmurhash3js = require("murmurhash3js");
26
26
  let node_fs = require("node:fs");
27
27
  node_fs = __toESM(node_fs);
28
28
  let crypto = require("crypto");
@@ -99,45 +99,1338 @@ var FHIRDateUtils = class {
99
99
  }
100
100
  };
101
101
  //#endregion
102
+ //#region node_modules/cuint/lib/uint32.js
103
+ var require_uint32 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
104
+ (function(root) {
105
+ UINT32(Math.pow(36, 5)), UINT32(Math.pow(16, 7)), UINT32(Math.pow(10, 9)), UINT32(Math.pow(2, 30));
106
+ UINT32(36), UINT32(16), UINT32(10), UINT32(2);
107
+ /**
108
+ * Represents an unsigned 32 bits integer
109
+ * @constructor
110
+ * @param {Number|String|Number} low bits | integer as a string | integer as a number
111
+ * @param {Number|Number|Undefined} high bits | radix (optional, default=10)
112
+ * @return
113
+ */
114
+ function UINT32(l, h) {
115
+ if (!(this instanceof UINT32)) return new UINT32(l, h);
116
+ this._low = 0;
117
+ this._high = 0;
118
+ this.remainder = null;
119
+ if (typeof h == "undefined") return fromNumber.call(this, l);
120
+ if (typeof l == "string") return fromString.call(this, l, h);
121
+ fromBits.call(this, l, h);
122
+ }
123
+ /**
124
+ * Set the current _UINT32_ object with its low and high bits
125
+ * @method fromBits
126
+ * @param {Number} low bits
127
+ * @param {Number} high bits
128
+ * @return ThisExpression
129
+ */
130
+ function fromBits(l, h) {
131
+ this._low = l | 0;
132
+ this._high = h | 0;
133
+ return this;
134
+ }
135
+ UINT32.prototype.fromBits = fromBits;
136
+ /**
137
+ * Set the current _UINT32_ object from a number
138
+ * @method fromNumber
139
+ * @param {Number} number
140
+ * @return ThisExpression
141
+ */
142
+ function fromNumber(value) {
143
+ this._low = value & 65535;
144
+ this._high = value >>> 16;
145
+ return this;
146
+ }
147
+ UINT32.prototype.fromNumber = fromNumber;
148
+ /**
149
+ * Set the current _UINT32_ object from a string
150
+ * @method fromString
151
+ * @param {String} integer as a string
152
+ * @param {Number} radix (optional, default=10)
153
+ * @return ThisExpression
154
+ */
155
+ function fromString(s, radix) {
156
+ var value = parseInt(s, radix || 10);
157
+ this._low = value & 65535;
158
+ this._high = value >>> 16;
159
+ return this;
160
+ }
161
+ UINT32.prototype.fromString = fromString;
162
+ /**
163
+ * Convert this _UINT32_ to a number
164
+ * @method toNumber
165
+ * @return {Number} the converted UINT32
166
+ */
167
+ UINT32.prototype.toNumber = function() {
168
+ return this._high * 65536 + this._low;
169
+ };
170
+ /**
171
+ * Convert this _UINT32_ to a string
172
+ * @method toString
173
+ * @param {Number} radix (optional, default=10)
174
+ * @return {String} the converted UINT32
175
+ */
176
+ UINT32.prototype.toString = function(radix) {
177
+ return this.toNumber().toString(radix || 10);
178
+ };
179
+ /**
180
+ * Add two _UINT32_. The current _UINT32_ stores the result
181
+ * @method add
182
+ * @param {Object} other UINT32
183
+ * @return ThisExpression
184
+ */
185
+ UINT32.prototype.add = function(other) {
186
+ var a00 = this._low + other._low;
187
+ var a16 = a00 >>> 16;
188
+ a16 += this._high + other._high;
189
+ this._low = a00 & 65535;
190
+ this._high = a16 & 65535;
191
+ return this;
192
+ };
193
+ /**
194
+ * Subtract two _UINT32_. The current _UINT32_ stores the result
195
+ * @method subtract
196
+ * @param {Object} other UINT32
197
+ * @return ThisExpression
198
+ */
199
+ UINT32.prototype.subtract = function(other) {
200
+ return this.add(other.clone().negate());
201
+ };
202
+ /**
203
+ * Multiply two _UINT32_. The current _UINT32_ stores the result
204
+ * @method multiply
205
+ * @param {Object} other UINT32
206
+ * @return ThisExpression
207
+ */
208
+ UINT32.prototype.multiply = function(other) {
209
+ var a16 = this._high;
210
+ var a00 = this._low;
211
+ var b16 = other._high;
212
+ var b00 = other._low;
213
+ var c16, c00 = a00 * b00;
214
+ c16 = c00 >>> 16;
215
+ c16 += a16 * b00;
216
+ c16 &= 65535;
217
+ c16 += a00 * b16;
218
+ this._low = c00 & 65535;
219
+ this._high = c16 & 65535;
220
+ return this;
221
+ };
222
+ /**
223
+ * Divide two _UINT32_. The current _UINT32_ stores the result.
224
+ * The remainder is made available as the _remainder_ property on
225
+ * the _UINT32_ object. It can be null, meaning there are no remainder.
226
+ * @method div
227
+ * @param {Object} other UINT32
228
+ * @return ThisExpression
229
+ */
230
+ UINT32.prototype.div = function(other) {
231
+ if (other._low == 0 && other._high == 0) throw Error("division by zero");
232
+ if (other._high == 0 && other._low == 1) {
233
+ this.remainder = new UINT32(0);
234
+ return this;
235
+ }
236
+ if (other.gt(this)) {
237
+ this.remainder = this.clone();
238
+ this._low = 0;
239
+ this._high = 0;
240
+ return this;
241
+ }
242
+ if (this.eq(other)) {
243
+ this.remainder = new UINT32(0);
244
+ this._low = 1;
245
+ this._high = 0;
246
+ return this;
247
+ }
248
+ var _other = other.clone();
249
+ var i = -1;
250
+ while (!this.lt(_other)) {
251
+ _other.shiftLeft(1, true);
252
+ i++;
253
+ }
254
+ this.remainder = this.clone();
255
+ this._low = 0;
256
+ this._high = 0;
257
+ for (; i >= 0; i--) {
258
+ _other.shiftRight(1);
259
+ if (!this.remainder.lt(_other)) {
260
+ this.remainder.subtract(_other);
261
+ if (i >= 16) this._high |= 1 << i - 16;
262
+ else this._low |= 1 << i;
263
+ }
264
+ }
265
+ return this;
266
+ };
267
+ /**
268
+ * Negate the current _UINT32_
269
+ * @method negate
270
+ * @return ThisExpression
271
+ */
272
+ UINT32.prototype.negate = function() {
273
+ var v = (~this._low & 65535) + 1;
274
+ this._low = v & 65535;
275
+ this._high = ~this._high + (v >>> 16) & 65535;
276
+ return this;
277
+ };
278
+ /**
279
+ * Equals
280
+ * @method eq
281
+ * @param {Object} other UINT32
282
+ * @return {Boolean}
283
+ */
284
+ UINT32.prototype.equals = UINT32.prototype.eq = function(other) {
285
+ return this._low == other._low && this._high == other._high;
286
+ };
287
+ /**
288
+ * Greater than (strict)
289
+ * @method gt
290
+ * @param {Object} other UINT32
291
+ * @return {Boolean}
292
+ */
293
+ UINT32.prototype.greaterThan = UINT32.prototype.gt = function(other) {
294
+ if (this._high > other._high) return true;
295
+ if (this._high < other._high) return false;
296
+ return this._low > other._low;
297
+ };
298
+ /**
299
+ * Less than (strict)
300
+ * @method lt
301
+ * @param {Object} other UINT32
302
+ * @return {Boolean}
303
+ */
304
+ UINT32.prototype.lessThan = UINT32.prototype.lt = function(other) {
305
+ if (this._high < other._high) return true;
306
+ if (this._high > other._high) return false;
307
+ return this._low < other._low;
308
+ };
309
+ /**
310
+ * Bitwise OR
311
+ * @method or
312
+ * @param {Object} other UINT32
313
+ * @return ThisExpression
314
+ */
315
+ UINT32.prototype.or = function(other) {
316
+ this._low |= other._low;
317
+ this._high |= other._high;
318
+ return this;
319
+ };
320
+ /**
321
+ * Bitwise AND
322
+ * @method and
323
+ * @param {Object} other UINT32
324
+ * @return ThisExpression
325
+ */
326
+ UINT32.prototype.and = function(other) {
327
+ this._low &= other._low;
328
+ this._high &= other._high;
329
+ return this;
330
+ };
331
+ /**
332
+ * Bitwise NOT
333
+ * @method not
334
+ * @return ThisExpression
335
+ */
336
+ UINT32.prototype.not = function() {
337
+ this._low = ~this._low & 65535;
338
+ this._high = ~this._high & 65535;
339
+ return this;
340
+ };
341
+ /**
342
+ * Bitwise XOR
343
+ * @method xor
344
+ * @param {Object} other UINT32
345
+ * @return ThisExpression
346
+ */
347
+ UINT32.prototype.xor = function(other) {
348
+ this._low ^= other._low;
349
+ this._high ^= other._high;
350
+ return this;
351
+ };
352
+ /**
353
+ * Bitwise shift right
354
+ * @method shiftRight
355
+ * @param {Number} number of bits to shift
356
+ * @return ThisExpression
357
+ */
358
+ UINT32.prototype.shiftRight = UINT32.prototype.shiftr = function(n) {
359
+ if (n > 16) {
360
+ this._low = this._high >> n - 16;
361
+ this._high = 0;
362
+ } else if (n == 16) {
363
+ this._low = this._high;
364
+ this._high = 0;
365
+ } else {
366
+ this._low = this._low >> n | this._high << 16 - n & 65535;
367
+ this._high >>= n;
368
+ }
369
+ return this;
370
+ };
371
+ /**
372
+ * Bitwise shift left
373
+ * @method shiftLeft
374
+ * @param {Number} number of bits to shift
375
+ * @param {Boolean} allow overflow
376
+ * @return ThisExpression
377
+ */
378
+ UINT32.prototype.shiftLeft = UINT32.prototype.shiftl = function(n, allowOverflow) {
379
+ if (n > 16) {
380
+ this._high = this._low << n - 16;
381
+ this._low = 0;
382
+ if (!allowOverflow) this._high &= 65535;
383
+ } else if (n == 16) {
384
+ this._high = this._low;
385
+ this._low = 0;
386
+ } else {
387
+ this._high = this._high << n | this._low >> 16 - n;
388
+ this._low = this._low << n & 65535;
389
+ if (!allowOverflow) this._high &= 65535;
390
+ }
391
+ return this;
392
+ };
393
+ /**
394
+ * Bitwise rotate left
395
+ * @method rotl
396
+ * @param {Number} number of bits to rotate
397
+ * @return ThisExpression
398
+ */
399
+ UINT32.prototype.rotateLeft = UINT32.prototype.rotl = function(n) {
400
+ var v = this._high << 16 | this._low;
401
+ v = v << n | v >>> 32 - n;
402
+ this._low = v & 65535;
403
+ this._high = v >>> 16;
404
+ return this;
405
+ };
406
+ /**
407
+ * Bitwise rotate right
408
+ * @method rotr
409
+ * @param {Number} number of bits to rotate
410
+ * @return ThisExpression
411
+ */
412
+ UINT32.prototype.rotateRight = UINT32.prototype.rotr = function(n) {
413
+ var v = this._high << 16 | this._low;
414
+ v = v >>> n | v << 32 - n;
415
+ this._low = v & 65535;
416
+ this._high = v >>> 16;
417
+ return this;
418
+ };
419
+ /**
420
+ * Clone the current _UINT32_
421
+ * @method clone
422
+ * @return {Object} cloned UINT32
423
+ */
424
+ UINT32.prototype.clone = function() {
425
+ return new UINT32(this._low, this._high);
426
+ };
427
+ if (typeof define != "undefined" && define.amd) define([], function() {
428
+ return UINT32;
429
+ });
430
+ else if (typeof module != "undefined" && module.exports) module.exports = UINT32;
431
+ else root["UINT32"] = UINT32;
432
+ })(exports);
433
+ }));
434
+ //#endregion
435
+ //#region node_modules/cuint/lib/uint64.js
436
+ var require_uint64 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
437
+ (function(root) {
438
+ var radixPowerCache = {
439
+ 16: UINT64(Math.pow(16, 5)),
440
+ 10: UINT64(Math.pow(10, 5)),
441
+ 2: UINT64(Math.pow(2, 5))
442
+ };
443
+ var radixCache = {
444
+ 16: UINT64(16),
445
+ 10: UINT64(10),
446
+ 2: UINT64(2)
447
+ };
448
+ /**
449
+ * Represents an unsigned 64 bits integer
450
+ * @constructor
451
+ * @param {Number} first low bits (8)
452
+ * @param {Number} second low bits (8)
453
+ * @param {Number} first high bits (8)
454
+ * @param {Number} second high bits (8)
455
+ * or
456
+ * @param {Number} low bits (32)
457
+ * @param {Number} high bits (32)
458
+ * or
459
+ * @param {String|Number} integer as a string | integer as a number
460
+ * @param {Number|Undefined} radix (optional, default=10)
461
+ * @return
462
+ */
463
+ function UINT64(a00, a16, a32, a48) {
464
+ if (!(this instanceof UINT64)) return new UINT64(a00, a16, a32, a48);
465
+ this.remainder = null;
466
+ if (typeof a00 == "string") return fromString.call(this, a00, a16);
467
+ if (typeof a16 == "undefined") return fromNumber.call(this, a00);
468
+ fromBits.apply(this, arguments);
469
+ }
470
+ /**
471
+ * Set the current _UINT64_ object with its low and high bits
472
+ * @method fromBits
473
+ * @param {Number} first low bits (8)
474
+ * @param {Number} second low bits (8)
475
+ * @param {Number} first high bits (8)
476
+ * @param {Number} second high bits (8)
477
+ * or
478
+ * @param {Number} low bits (32)
479
+ * @param {Number} high bits (32)
480
+ * @return ThisExpression
481
+ */
482
+ function fromBits(a00, a16, a32, a48) {
483
+ if (typeof a32 == "undefined") {
484
+ this._a00 = a00 & 65535;
485
+ this._a16 = a00 >>> 16;
486
+ this._a32 = a16 & 65535;
487
+ this._a48 = a16 >>> 16;
488
+ return this;
489
+ }
490
+ this._a00 = a00 | 0;
491
+ this._a16 = a16 | 0;
492
+ this._a32 = a32 | 0;
493
+ this._a48 = a48 | 0;
494
+ return this;
495
+ }
496
+ UINT64.prototype.fromBits = fromBits;
497
+ /**
498
+ * Set the current _UINT64_ object from a number
499
+ * @method fromNumber
500
+ * @param {Number} number
501
+ * @return ThisExpression
502
+ */
503
+ function fromNumber(value) {
504
+ this._a00 = value & 65535;
505
+ this._a16 = value >>> 16;
506
+ this._a32 = 0;
507
+ this._a48 = 0;
508
+ return this;
509
+ }
510
+ UINT64.prototype.fromNumber = fromNumber;
511
+ /**
512
+ * Set the current _UINT64_ object from a string
513
+ * @method fromString
514
+ * @param {String} integer as a string
515
+ * @param {Number} radix (optional, default=10)
516
+ * @return ThisExpression
517
+ */
518
+ function fromString(s, radix) {
519
+ radix = radix || 10;
520
+ this._a00 = 0;
521
+ this._a16 = 0;
522
+ this._a32 = 0;
523
+ this._a48 = 0;
524
+ var radixUint = radixPowerCache[radix] || new UINT64(Math.pow(radix, 5));
525
+ for (var i = 0, len = s.length; i < len; i += 5) {
526
+ var size = Math.min(5, len - i);
527
+ var value = parseInt(s.slice(i, i + size), radix);
528
+ this.multiply(size < 5 ? new UINT64(Math.pow(radix, size)) : radixUint).add(new UINT64(value));
529
+ }
530
+ return this;
531
+ }
532
+ UINT64.prototype.fromString = fromString;
533
+ /**
534
+ * Convert this _UINT64_ to a number (last 32 bits are dropped)
535
+ * @method toNumber
536
+ * @return {Number} the converted UINT64
537
+ */
538
+ UINT64.prototype.toNumber = function() {
539
+ return this._a16 * 65536 + this._a00;
540
+ };
541
+ /**
542
+ * Convert this _UINT64_ to a string
543
+ * @method toString
544
+ * @param {Number} radix (optional, default=10)
545
+ * @return {String} the converted UINT64
546
+ */
547
+ UINT64.prototype.toString = function(radix) {
548
+ radix = radix || 10;
549
+ var radixUint = radixCache[radix] || new UINT64(radix);
550
+ if (!this.gt(radixUint)) return this.toNumber().toString(radix);
551
+ var self = this.clone();
552
+ var res = new Array(64);
553
+ for (var i = 63; i >= 0; i--) {
554
+ self.div(radixUint);
555
+ res[i] = self.remainder.toNumber().toString(radix);
556
+ if (!self.gt(radixUint)) break;
557
+ }
558
+ res[i - 1] = self.toNumber().toString(radix);
559
+ return res.join("");
560
+ };
561
+ /**
562
+ * Add two _UINT64_. The current _UINT64_ stores the result
563
+ * @method add
564
+ * @param {Object} other UINT64
565
+ * @return ThisExpression
566
+ */
567
+ UINT64.prototype.add = function(other) {
568
+ var a00 = this._a00 + other._a00;
569
+ var a16 = a00 >>> 16;
570
+ a16 += this._a16 + other._a16;
571
+ var a32 = a16 >>> 16;
572
+ a32 += this._a32 + other._a32;
573
+ var a48 = a32 >>> 16;
574
+ a48 += this._a48 + other._a48;
575
+ this._a00 = a00 & 65535;
576
+ this._a16 = a16 & 65535;
577
+ this._a32 = a32 & 65535;
578
+ this._a48 = a48 & 65535;
579
+ return this;
580
+ };
581
+ /**
582
+ * Subtract two _UINT64_. The current _UINT64_ stores the result
583
+ * @method subtract
584
+ * @param {Object} other UINT64
585
+ * @return ThisExpression
586
+ */
587
+ UINT64.prototype.subtract = function(other) {
588
+ return this.add(other.clone().negate());
589
+ };
590
+ /**
591
+ * Multiply two _UINT64_. The current _UINT64_ stores the result
592
+ * @method multiply
593
+ * @param {Object} other UINT64
594
+ * @return ThisExpression
595
+ */
596
+ UINT64.prototype.multiply = function(other) {
597
+ var a00 = this._a00;
598
+ var a16 = this._a16;
599
+ var a32 = this._a32;
600
+ var a48 = this._a48;
601
+ var b00 = other._a00;
602
+ var b16 = other._a16;
603
+ var b32 = other._a32;
604
+ var b48 = other._a48;
605
+ var c00 = a00 * b00;
606
+ var c16 = c00 >>> 16;
607
+ c16 += a00 * b16;
608
+ var c32 = c16 >>> 16;
609
+ c16 &= 65535;
610
+ c16 += a16 * b00;
611
+ c32 += c16 >>> 16;
612
+ c32 += a00 * b32;
613
+ var c48 = c32 >>> 16;
614
+ c32 &= 65535;
615
+ c32 += a16 * b16;
616
+ c48 += c32 >>> 16;
617
+ c32 &= 65535;
618
+ c32 += a32 * b00;
619
+ c48 += c32 >>> 16;
620
+ c48 += a00 * b48;
621
+ c48 &= 65535;
622
+ c48 += a16 * b32;
623
+ c48 &= 65535;
624
+ c48 += a32 * b16;
625
+ c48 &= 65535;
626
+ c48 += a48 * b00;
627
+ this._a00 = c00 & 65535;
628
+ this._a16 = c16 & 65535;
629
+ this._a32 = c32 & 65535;
630
+ this._a48 = c48 & 65535;
631
+ return this;
632
+ };
633
+ /**
634
+ * Divide two _UINT64_. The current _UINT64_ stores the result.
635
+ * The remainder is made available as the _remainder_ property on
636
+ * the _UINT64_ object. It can be null, meaning there are no remainder.
637
+ * @method div
638
+ * @param {Object} other UINT64
639
+ * @return ThisExpression
640
+ */
641
+ UINT64.prototype.div = function(other) {
642
+ if (other._a16 == 0 && other._a32 == 0 && other._a48 == 0) {
643
+ if (other._a00 == 0) throw Error("division by zero");
644
+ if (other._a00 == 1) {
645
+ this.remainder = new UINT64(0);
646
+ return this;
647
+ }
648
+ }
649
+ if (other.gt(this)) {
650
+ this.remainder = this.clone();
651
+ this._a00 = 0;
652
+ this._a16 = 0;
653
+ this._a32 = 0;
654
+ this._a48 = 0;
655
+ return this;
656
+ }
657
+ if (this.eq(other)) {
658
+ this.remainder = new UINT64(0);
659
+ this._a00 = 1;
660
+ this._a16 = 0;
661
+ this._a32 = 0;
662
+ this._a48 = 0;
663
+ return this;
664
+ }
665
+ var _other = other.clone();
666
+ var i = -1;
667
+ while (!this.lt(_other)) {
668
+ _other.shiftLeft(1, true);
669
+ i++;
670
+ }
671
+ this.remainder = this.clone();
672
+ this._a00 = 0;
673
+ this._a16 = 0;
674
+ this._a32 = 0;
675
+ this._a48 = 0;
676
+ for (; i >= 0; i--) {
677
+ _other.shiftRight(1);
678
+ if (!this.remainder.lt(_other)) {
679
+ this.remainder.subtract(_other);
680
+ if (i >= 48) this._a48 |= 1 << i - 48;
681
+ else if (i >= 32) this._a32 |= 1 << i - 32;
682
+ else if (i >= 16) this._a16 |= 1 << i - 16;
683
+ else this._a00 |= 1 << i;
684
+ }
685
+ }
686
+ return this;
687
+ };
688
+ /**
689
+ * Negate the current _UINT64_
690
+ * @method negate
691
+ * @return ThisExpression
692
+ */
693
+ UINT64.prototype.negate = function() {
694
+ var v = (~this._a00 & 65535) + 1;
695
+ this._a00 = v & 65535;
696
+ v = (~this._a16 & 65535) + (v >>> 16);
697
+ this._a16 = v & 65535;
698
+ v = (~this._a32 & 65535) + (v >>> 16);
699
+ this._a32 = v & 65535;
700
+ this._a48 = ~this._a48 + (v >>> 16) & 65535;
701
+ return this;
702
+ };
703
+ /**
704
+
705
+ * @method eq
706
+ * @param {Object} other UINT64
707
+ * @return {Boolean}
708
+ */
709
+ UINT64.prototype.equals = UINT64.prototype.eq = function(other) {
710
+ return this._a48 == other._a48 && this._a00 == other._a00 && this._a32 == other._a32 && this._a16 == other._a16;
711
+ };
712
+ /**
713
+ * Greater than (strict)
714
+ * @method gt
715
+ * @param {Object} other UINT64
716
+ * @return {Boolean}
717
+ */
718
+ UINT64.prototype.greaterThan = UINT64.prototype.gt = function(other) {
719
+ if (this._a48 > other._a48) return true;
720
+ if (this._a48 < other._a48) return false;
721
+ if (this._a32 > other._a32) return true;
722
+ if (this._a32 < other._a32) return false;
723
+ if (this._a16 > other._a16) return true;
724
+ if (this._a16 < other._a16) return false;
725
+ return this._a00 > other._a00;
726
+ };
727
+ /**
728
+ * Less than (strict)
729
+ * @method lt
730
+ * @param {Object} other UINT64
731
+ * @return {Boolean}
732
+ */
733
+ UINT64.prototype.lessThan = UINT64.prototype.lt = function(other) {
734
+ if (this._a48 < other._a48) return true;
735
+ if (this._a48 > other._a48) return false;
736
+ if (this._a32 < other._a32) return true;
737
+ if (this._a32 > other._a32) return false;
738
+ if (this._a16 < other._a16) return true;
739
+ if (this._a16 > other._a16) return false;
740
+ return this._a00 < other._a00;
741
+ };
742
+ /**
743
+ * Bitwise OR
744
+ * @method or
745
+ * @param {Object} other UINT64
746
+ * @return ThisExpression
747
+ */
748
+ UINT64.prototype.or = function(other) {
749
+ this._a00 |= other._a00;
750
+ this._a16 |= other._a16;
751
+ this._a32 |= other._a32;
752
+ this._a48 |= other._a48;
753
+ return this;
754
+ };
755
+ /**
756
+ * Bitwise AND
757
+ * @method and
758
+ * @param {Object} other UINT64
759
+ * @return ThisExpression
760
+ */
761
+ UINT64.prototype.and = function(other) {
762
+ this._a00 &= other._a00;
763
+ this._a16 &= other._a16;
764
+ this._a32 &= other._a32;
765
+ this._a48 &= other._a48;
766
+ return this;
767
+ };
768
+ /**
769
+ * Bitwise XOR
770
+ * @method xor
771
+ * @param {Object} other UINT64
772
+ * @return ThisExpression
773
+ */
774
+ UINT64.prototype.xor = function(other) {
775
+ this._a00 ^= other._a00;
776
+ this._a16 ^= other._a16;
777
+ this._a32 ^= other._a32;
778
+ this._a48 ^= other._a48;
779
+ return this;
780
+ };
781
+ /**
782
+ * Bitwise NOT
783
+ * @method not
784
+ * @return ThisExpression
785
+ */
786
+ UINT64.prototype.not = function() {
787
+ this._a00 = ~this._a00 & 65535;
788
+ this._a16 = ~this._a16 & 65535;
789
+ this._a32 = ~this._a32 & 65535;
790
+ this._a48 = ~this._a48 & 65535;
791
+ return this;
792
+ };
793
+ /**
794
+ * Bitwise shift right
795
+ * @method shiftRight
796
+ * @param {Number} number of bits to shift
797
+ * @return ThisExpression
798
+ */
799
+ UINT64.prototype.shiftRight = UINT64.prototype.shiftr = function(n) {
800
+ n %= 64;
801
+ if (n >= 48) {
802
+ this._a00 = this._a48 >> n - 48;
803
+ this._a16 = 0;
804
+ this._a32 = 0;
805
+ this._a48 = 0;
806
+ } else if (n >= 32) {
807
+ n -= 32;
808
+ this._a00 = (this._a32 >> n | this._a48 << 16 - n) & 65535;
809
+ this._a16 = this._a48 >> n & 65535;
810
+ this._a32 = 0;
811
+ this._a48 = 0;
812
+ } else if (n >= 16) {
813
+ n -= 16;
814
+ this._a00 = (this._a16 >> n | this._a32 << 16 - n) & 65535;
815
+ this._a16 = (this._a32 >> n | this._a48 << 16 - n) & 65535;
816
+ this._a32 = this._a48 >> n & 65535;
817
+ this._a48 = 0;
818
+ } else {
819
+ this._a00 = (this._a00 >> n | this._a16 << 16 - n) & 65535;
820
+ this._a16 = (this._a16 >> n | this._a32 << 16 - n) & 65535;
821
+ this._a32 = (this._a32 >> n | this._a48 << 16 - n) & 65535;
822
+ this._a48 = this._a48 >> n & 65535;
823
+ }
824
+ return this;
825
+ };
826
+ /**
827
+ * Bitwise shift left
828
+ * @method shiftLeft
829
+ * @param {Number} number of bits to shift
830
+ * @param {Boolean} allow overflow
831
+ * @return ThisExpression
832
+ */
833
+ UINT64.prototype.shiftLeft = UINT64.prototype.shiftl = function(n, allowOverflow) {
834
+ n %= 64;
835
+ if (n >= 48) {
836
+ this._a48 = this._a00 << n - 48;
837
+ this._a32 = 0;
838
+ this._a16 = 0;
839
+ this._a00 = 0;
840
+ } else if (n >= 32) {
841
+ n -= 32;
842
+ this._a48 = this._a16 << n | this._a00 >> 16 - n;
843
+ this._a32 = this._a00 << n & 65535;
844
+ this._a16 = 0;
845
+ this._a00 = 0;
846
+ } else if (n >= 16) {
847
+ n -= 16;
848
+ this._a48 = this._a32 << n | this._a16 >> 16 - n;
849
+ this._a32 = (this._a16 << n | this._a00 >> 16 - n) & 65535;
850
+ this._a16 = this._a00 << n & 65535;
851
+ this._a00 = 0;
852
+ } else {
853
+ this._a48 = this._a48 << n | this._a32 >> 16 - n;
854
+ this._a32 = (this._a32 << n | this._a16 >> 16 - n) & 65535;
855
+ this._a16 = (this._a16 << n | this._a00 >> 16 - n) & 65535;
856
+ this._a00 = this._a00 << n & 65535;
857
+ }
858
+ if (!allowOverflow) this._a48 &= 65535;
859
+ return this;
860
+ };
861
+ /**
862
+ * Bitwise rotate left
863
+ * @method rotl
864
+ * @param {Number} number of bits to rotate
865
+ * @return ThisExpression
866
+ */
867
+ UINT64.prototype.rotateLeft = UINT64.prototype.rotl = function(n) {
868
+ n %= 64;
869
+ if (n == 0) return this;
870
+ if (n >= 32) {
871
+ var v = this._a00;
872
+ this._a00 = this._a32;
873
+ this._a32 = v;
874
+ v = this._a48;
875
+ this._a48 = this._a16;
876
+ this._a16 = v;
877
+ if (n == 32) return this;
878
+ n -= 32;
879
+ }
880
+ var high = this._a48 << 16 | this._a32;
881
+ var low = this._a16 << 16 | this._a00;
882
+ var _high = high << n | low >>> 32 - n;
883
+ var _low = low << n | high >>> 32 - n;
884
+ this._a00 = _low & 65535;
885
+ this._a16 = _low >>> 16;
886
+ this._a32 = _high & 65535;
887
+ this._a48 = _high >>> 16;
888
+ return this;
889
+ };
890
+ /**
891
+ * Bitwise rotate right
892
+ * @method rotr
893
+ * @param {Number} number of bits to rotate
894
+ * @return ThisExpression
895
+ */
896
+ UINT64.prototype.rotateRight = UINT64.prototype.rotr = function(n) {
897
+ n %= 64;
898
+ if (n == 0) return this;
899
+ if (n >= 32) {
900
+ var v = this._a00;
901
+ this._a00 = this._a32;
902
+ this._a32 = v;
903
+ v = this._a48;
904
+ this._a48 = this._a16;
905
+ this._a16 = v;
906
+ if (n == 32) return this;
907
+ n -= 32;
908
+ }
909
+ var high = this._a48 << 16 | this._a32;
910
+ var low = this._a16 << 16 | this._a00;
911
+ var _high = high >>> n | low << 32 - n;
912
+ var _low = low >>> n | high << 32 - n;
913
+ this._a00 = _low & 65535;
914
+ this._a16 = _low >>> 16;
915
+ this._a32 = _high & 65535;
916
+ this._a48 = _high >>> 16;
917
+ return this;
918
+ };
919
+ /**
920
+ * Clone the current _UINT64_
921
+ * @method clone
922
+ * @return {Object} cloned UINT64
923
+ */
924
+ UINT64.prototype.clone = function() {
925
+ return new UINT64(this._a00, this._a16, this._a32, this._a48);
926
+ };
927
+ if (typeof define != "undefined" && define.amd) define([], function() {
928
+ return UINT64;
929
+ });
930
+ else if (typeof module != "undefined" && module.exports) module.exports = UINT64;
931
+ else root["UINT64"] = UINT64;
932
+ })(exports);
933
+ }));
934
+ //#endregion
935
+ //#region node_modules/cuint/index.js
936
+ var require_cuint = /* @__PURE__ */ __commonJSMin(((exports) => {
937
+ exports.UINT32 = require_uint32();
938
+ exports.UINT64 = require_uint64();
939
+ }));
940
+ //#endregion
941
+ //#region node_modules/xxhashjs/lib/xxhash.js
942
+ var require_xxhash = /* @__PURE__ */ __commonJSMin(((exports, module) => {
943
+ /**
944
+ xxHash implementation in pure Javascript
945
+
946
+ Copyright (C) 2013, Pierre Curto
947
+ MIT license
948
+ */
949
+ var UINT32 = require_cuint().UINT32;
950
+ UINT32.prototype.xxh_update = function(low, high) {
951
+ var b00 = PRIME32_2._low;
952
+ var b16 = PRIME32_2._high;
953
+ var c16, c00 = low * b00;
954
+ c16 = c00 >>> 16;
955
+ c16 += high * b00;
956
+ c16 &= 65535;
957
+ c16 += low * b16;
958
+ var a00 = this._low + (c00 & 65535);
959
+ var a16 = a00 >>> 16;
960
+ a16 += this._high + (c16 & 65535);
961
+ var v = a16 << 16 | a00 & 65535;
962
+ v = v << 13 | v >>> 19;
963
+ a00 = v & 65535;
964
+ a16 = v >>> 16;
965
+ b00 = PRIME32_1._low;
966
+ b16 = PRIME32_1._high;
967
+ c00 = a00 * b00;
968
+ c16 = c00 >>> 16;
969
+ c16 += a16 * b00;
970
+ c16 &= 65535;
971
+ c16 += a00 * b16;
972
+ this._low = c00 & 65535;
973
+ this._high = c16 & 65535;
974
+ };
975
+ var PRIME32_1 = UINT32("2654435761");
976
+ var PRIME32_2 = UINT32("2246822519");
977
+ var PRIME32_3 = UINT32("3266489917");
978
+ var PRIME32_4 = UINT32("668265263");
979
+ var PRIME32_5 = UINT32("374761393");
980
+ /**
981
+ * Convert string to proper UTF-8 array
982
+ * @param str Input string
983
+ * @returns {Uint8Array} UTF8 array is returned as uint8 array
984
+ */
985
+ function toUTF8Array(str) {
986
+ var utf8 = [];
987
+ for (var i = 0, n = str.length; i < n; i++) {
988
+ var charcode = str.charCodeAt(i);
989
+ if (charcode < 128) utf8.push(charcode);
990
+ else if (charcode < 2048) utf8.push(192 | charcode >> 6, 128 | charcode & 63);
991
+ else if (charcode < 55296 || charcode >= 57344) utf8.push(224 | charcode >> 12, 128 | charcode >> 6 & 63, 128 | charcode & 63);
992
+ else {
993
+ i++;
994
+ charcode = 65536 + ((charcode & 1023) << 10 | str.charCodeAt(i) & 1023);
995
+ utf8.push(240 | charcode >> 18, 128 | charcode >> 12 & 63, 128 | charcode >> 6 & 63, 128 | charcode & 63);
996
+ }
997
+ }
998
+ return new Uint8Array(utf8);
999
+ }
1000
+ /**
1001
+ * XXH object used as a constructor or a function
1002
+ * @constructor
1003
+ * or
1004
+ * @param {Object|String} input data
1005
+ * @param {Number|UINT32} seed
1006
+ * @return ThisExpression
1007
+ * or
1008
+ * @return {UINT32} xxHash
1009
+ */
1010
+ function XXH() {
1011
+ if (arguments.length == 2) return new XXH(arguments[1]).update(arguments[0]).digest();
1012
+ if (!(this instanceof XXH)) return new XXH(arguments[0]);
1013
+ init.call(this, arguments[0]);
1014
+ }
1015
+ /**
1016
+ * Initialize the XXH instance with the given seed
1017
+ * @method init
1018
+ * @param {Number|Object} seed as a number or an unsigned 32 bits integer
1019
+ * @return ThisExpression
1020
+ */
1021
+ function init(seed) {
1022
+ this.seed = seed instanceof UINT32 ? seed.clone() : UINT32(seed);
1023
+ this.v1 = this.seed.clone().add(PRIME32_1).add(PRIME32_2);
1024
+ this.v2 = this.seed.clone().add(PRIME32_2);
1025
+ this.v3 = this.seed.clone();
1026
+ this.v4 = this.seed.clone().subtract(PRIME32_1);
1027
+ this.total_len = 0;
1028
+ this.memsize = 0;
1029
+ this.memory = null;
1030
+ return this;
1031
+ }
1032
+ XXH.prototype.init = init;
1033
+ /**
1034
+ * Add data to be computed for the XXH hash
1035
+ * @method update
1036
+ * @param {String|Buffer|ArrayBuffer} input as a string or nodejs Buffer or ArrayBuffer
1037
+ * @return ThisExpression
1038
+ */
1039
+ XXH.prototype.update = function(input) {
1040
+ var isString = typeof input == "string";
1041
+ var isArrayBuffer;
1042
+ if (isString) {
1043
+ input = toUTF8Array(input);
1044
+ isString = false;
1045
+ isArrayBuffer = true;
1046
+ }
1047
+ if (typeof ArrayBuffer !== "undefined" && input instanceof ArrayBuffer) {
1048
+ isArrayBuffer = true;
1049
+ input = new Uint8Array(input);
1050
+ }
1051
+ var p = 0;
1052
+ var len = input.length;
1053
+ var bEnd = p + len;
1054
+ if (len == 0) return this;
1055
+ this.total_len += len;
1056
+ if (this.memsize == 0) if (isString) this.memory = "";
1057
+ else if (isArrayBuffer) this.memory = new Uint8Array(16);
1058
+ else this.memory = new Buffer(16);
1059
+ if (this.memsize + len < 16) {
1060
+ if (isString) this.memory += input;
1061
+ else if (isArrayBuffer) this.memory.set(input.subarray(0, len), this.memsize);
1062
+ else input.copy(this.memory, this.memsize, 0, len);
1063
+ this.memsize += len;
1064
+ return this;
1065
+ }
1066
+ if (this.memsize > 0) {
1067
+ if (isString) this.memory += input.slice(0, 16 - this.memsize);
1068
+ else if (isArrayBuffer) this.memory.set(input.subarray(0, 16 - this.memsize), this.memsize);
1069
+ else input.copy(this.memory, this.memsize, 0, 16 - this.memsize);
1070
+ var p32 = 0;
1071
+ if (isString) {
1072
+ this.v1.xxh_update(this.memory.charCodeAt(p32 + 1) << 8 | this.memory.charCodeAt(p32), this.memory.charCodeAt(p32 + 3) << 8 | this.memory.charCodeAt(p32 + 2));
1073
+ p32 += 4;
1074
+ this.v2.xxh_update(this.memory.charCodeAt(p32 + 1) << 8 | this.memory.charCodeAt(p32), this.memory.charCodeAt(p32 + 3) << 8 | this.memory.charCodeAt(p32 + 2));
1075
+ p32 += 4;
1076
+ this.v3.xxh_update(this.memory.charCodeAt(p32 + 1) << 8 | this.memory.charCodeAt(p32), this.memory.charCodeAt(p32 + 3) << 8 | this.memory.charCodeAt(p32 + 2));
1077
+ p32 += 4;
1078
+ this.v4.xxh_update(this.memory.charCodeAt(p32 + 1) << 8 | this.memory.charCodeAt(p32), this.memory.charCodeAt(p32 + 3) << 8 | this.memory.charCodeAt(p32 + 2));
1079
+ } else {
1080
+ this.v1.xxh_update(this.memory[p32 + 1] << 8 | this.memory[p32], this.memory[p32 + 3] << 8 | this.memory[p32 + 2]);
1081
+ p32 += 4;
1082
+ this.v2.xxh_update(this.memory[p32 + 1] << 8 | this.memory[p32], this.memory[p32 + 3] << 8 | this.memory[p32 + 2]);
1083
+ p32 += 4;
1084
+ this.v3.xxh_update(this.memory[p32 + 1] << 8 | this.memory[p32], this.memory[p32 + 3] << 8 | this.memory[p32 + 2]);
1085
+ p32 += 4;
1086
+ this.v4.xxh_update(this.memory[p32 + 1] << 8 | this.memory[p32], this.memory[p32 + 3] << 8 | this.memory[p32 + 2]);
1087
+ }
1088
+ p += 16 - this.memsize;
1089
+ this.memsize = 0;
1090
+ if (isString) this.memory = "";
1091
+ }
1092
+ if (p <= bEnd - 16) {
1093
+ var limit = bEnd - 16;
1094
+ do {
1095
+ if (isString) {
1096
+ this.v1.xxh_update(input.charCodeAt(p + 1) << 8 | input.charCodeAt(p), input.charCodeAt(p + 3) << 8 | input.charCodeAt(p + 2));
1097
+ p += 4;
1098
+ this.v2.xxh_update(input.charCodeAt(p + 1) << 8 | input.charCodeAt(p), input.charCodeAt(p + 3) << 8 | input.charCodeAt(p + 2));
1099
+ p += 4;
1100
+ this.v3.xxh_update(input.charCodeAt(p + 1) << 8 | input.charCodeAt(p), input.charCodeAt(p + 3) << 8 | input.charCodeAt(p + 2));
1101
+ p += 4;
1102
+ this.v4.xxh_update(input.charCodeAt(p + 1) << 8 | input.charCodeAt(p), input.charCodeAt(p + 3) << 8 | input.charCodeAt(p + 2));
1103
+ } else {
1104
+ this.v1.xxh_update(input[p + 1] << 8 | input[p], input[p + 3] << 8 | input[p + 2]);
1105
+ p += 4;
1106
+ this.v2.xxh_update(input[p + 1] << 8 | input[p], input[p + 3] << 8 | input[p + 2]);
1107
+ p += 4;
1108
+ this.v3.xxh_update(input[p + 1] << 8 | input[p], input[p + 3] << 8 | input[p + 2]);
1109
+ p += 4;
1110
+ this.v4.xxh_update(input[p + 1] << 8 | input[p], input[p + 3] << 8 | input[p + 2]);
1111
+ }
1112
+ p += 4;
1113
+ } while (p <= limit);
1114
+ }
1115
+ if (p < bEnd) {
1116
+ if (isString) this.memory += input.slice(p);
1117
+ else if (isArrayBuffer) this.memory.set(input.subarray(p, bEnd), this.memsize);
1118
+ else input.copy(this.memory, this.memsize, p, bEnd);
1119
+ this.memsize = bEnd - p;
1120
+ }
1121
+ return this;
1122
+ };
1123
+ /**
1124
+ * Finalize the XXH computation. The XXH instance is ready for reuse for the given seed
1125
+ * @method digest
1126
+ * @return {UINT32} xxHash
1127
+ */
1128
+ XXH.prototype.digest = function() {
1129
+ var input = this.memory;
1130
+ var isString = typeof input == "string";
1131
+ var p = 0;
1132
+ var bEnd = this.memsize;
1133
+ var h32, h;
1134
+ var u = new UINT32();
1135
+ if (this.total_len >= 16) h32 = this.v1.rotl(1).add(this.v2.rotl(7).add(this.v3.rotl(12).add(this.v4.rotl(18))));
1136
+ else h32 = this.seed.clone().add(PRIME32_5);
1137
+ h32.add(u.fromNumber(this.total_len));
1138
+ while (p <= bEnd - 4) {
1139
+ if (isString) u.fromBits(input.charCodeAt(p + 1) << 8 | input.charCodeAt(p), input.charCodeAt(p + 3) << 8 | input.charCodeAt(p + 2));
1140
+ else u.fromBits(input[p + 1] << 8 | input[p], input[p + 3] << 8 | input[p + 2]);
1141
+ h32.add(u.multiply(PRIME32_3)).rotl(17).multiply(PRIME32_4);
1142
+ p += 4;
1143
+ }
1144
+ while (p < bEnd) {
1145
+ u.fromBits(isString ? input.charCodeAt(p++) : input[p++], 0);
1146
+ h32.add(u.multiply(PRIME32_5)).rotl(11).multiply(PRIME32_1);
1147
+ }
1148
+ h = h32.clone().shiftRight(15);
1149
+ h32.xor(h).multiply(PRIME32_2);
1150
+ h = h32.clone().shiftRight(13);
1151
+ h32.xor(h).multiply(PRIME32_3);
1152
+ h = h32.clone().shiftRight(16);
1153
+ h32.xor(h);
1154
+ this.init(this.seed);
1155
+ return h32;
1156
+ };
1157
+ module.exports = XXH;
1158
+ }));
1159
+ //#endregion
1160
+ //#region node_modules/xxhashjs/lib/xxhash64.js
1161
+ var require_xxhash64 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
1162
+ /**
1163
+ xxHash64 implementation in pure Javascript
1164
+
1165
+ Copyright (C) 2016, Pierre Curto
1166
+ MIT license
1167
+ */
1168
+ var UINT64 = require_cuint().UINT64;
1169
+ var PRIME64_1 = UINT64("11400714785074694791");
1170
+ var PRIME64_2 = UINT64("14029467366897019727");
1171
+ var PRIME64_3 = UINT64("1609587929392839161");
1172
+ var PRIME64_4 = UINT64("9650029242287828579");
1173
+ var PRIME64_5 = UINT64("2870177450012600261");
1174
+ /**
1175
+ * Convert string to proper UTF-8 array
1176
+ * @param str Input string
1177
+ * @returns {Uint8Array} UTF8 array is returned as uint8 array
1178
+ */
1179
+ function toUTF8Array(str) {
1180
+ var utf8 = [];
1181
+ for (var i = 0, n = str.length; i < n; i++) {
1182
+ var charcode = str.charCodeAt(i);
1183
+ if (charcode < 128) utf8.push(charcode);
1184
+ else if (charcode < 2048) utf8.push(192 | charcode >> 6, 128 | charcode & 63);
1185
+ else if (charcode < 55296 || charcode >= 57344) utf8.push(224 | charcode >> 12, 128 | charcode >> 6 & 63, 128 | charcode & 63);
1186
+ else {
1187
+ i++;
1188
+ charcode = 65536 + ((charcode & 1023) << 10 | str.charCodeAt(i) & 1023);
1189
+ utf8.push(240 | charcode >> 18, 128 | charcode >> 12 & 63, 128 | charcode >> 6 & 63, 128 | charcode & 63);
1190
+ }
1191
+ }
1192
+ return new Uint8Array(utf8);
1193
+ }
1194
+ /**
1195
+ * XXH64 object used as a constructor or a function
1196
+ * @constructor
1197
+ * or
1198
+ * @param {Object|String} input data
1199
+ * @param {Number|UINT64} seed
1200
+ * @return ThisExpression
1201
+ * or
1202
+ * @return {UINT64} xxHash
1203
+ */
1204
+ function XXH64() {
1205
+ if (arguments.length == 2) return new XXH64(arguments[1]).update(arguments[0]).digest();
1206
+ if (!(this instanceof XXH64)) return new XXH64(arguments[0]);
1207
+ init.call(this, arguments[0]);
1208
+ }
1209
+ /**
1210
+ * Initialize the XXH64 instance with the given seed
1211
+ * @method init
1212
+ * @param {Number|Object} seed as a number or an unsigned 32 bits integer
1213
+ * @return ThisExpression
1214
+ */
1215
+ function init(seed) {
1216
+ this.seed = seed instanceof UINT64 ? seed.clone() : UINT64(seed);
1217
+ this.v1 = this.seed.clone().add(PRIME64_1).add(PRIME64_2);
1218
+ this.v2 = this.seed.clone().add(PRIME64_2);
1219
+ this.v3 = this.seed.clone();
1220
+ this.v4 = this.seed.clone().subtract(PRIME64_1);
1221
+ this.total_len = 0;
1222
+ this.memsize = 0;
1223
+ this.memory = null;
1224
+ return this;
1225
+ }
1226
+ XXH64.prototype.init = init;
1227
+ /**
1228
+ * Add data to be computed for the XXH64 hash
1229
+ * @method update
1230
+ * @param {String|Buffer|ArrayBuffer} input as a string or nodejs Buffer or ArrayBuffer
1231
+ * @return ThisExpression
1232
+ */
1233
+ XXH64.prototype.update = function(input) {
1234
+ var isString = typeof input == "string";
1235
+ var isArrayBuffer;
1236
+ if (isString) {
1237
+ input = toUTF8Array(input);
1238
+ isString = false;
1239
+ isArrayBuffer = true;
1240
+ }
1241
+ if (typeof ArrayBuffer !== "undefined" && input instanceof ArrayBuffer) {
1242
+ isArrayBuffer = true;
1243
+ input = new Uint8Array(input);
1244
+ }
1245
+ var p = 0;
1246
+ var len = input.length;
1247
+ var bEnd = p + len;
1248
+ if (len == 0) return this;
1249
+ this.total_len += len;
1250
+ if (this.memsize == 0) if (isString) this.memory = "";
1251
+ else if (isArrayBuffer) this.memory = new Uint8Array(32);
1252
+ else this.memory = new Buffer(32);
1253
+ if (this.memsize + len < 32) {
1254
+ if (isString) this.memory += input;
1255
+ else if (isArrayBuffer) this.memory.set(input.subarray(0, len), this.memsize);
1256
+ else input.copy(this.memory, this.memsize, 0, len);
1257
+ this.memsize += len;
1258
+ return this;
1259
+ }
1260
+ if (this.memsize > 0) {
1261
+ if (isString) this.memory += input.slice(0, 32 - this.memsize);
1262
+ else if (isArrayBuffer) this.memory.set(input.subarray(0, 32 - this.memsize), this.memsize);
1263
+ else input.copy(this.memory, this.memsize, 0, 32 - this.memsize);
1264
+ var p64 = 0;
1265
+ if (isString) {
1266
+ var other = UINT64(this.memory.charCodeAt(p64 + 1) << 8 | this.memory.charCodeAt(p64), this.memory.charCodeAt(p64 + 3) << 8 | this.memory.charCodeAt(p64 + 2), this.memory.charCodeAt(p64 + 5) << 8 | this.memory.charCodeAt(p64 + 4), this.memory.charCodeAt(p64 + 7) << 8 | this.memory.charCodeAt(p64 + 6));
1267
+ this.v1.add(other.multiply(PRIME64_2)).rotl(31).multiply(PRIME64_1);
1268
+ p64 += 8;
1269
+ other = UINT64(this.memory.charCodeAt(p64 + 1) << 8 | this.memory.charCodeAt(p64), this.memory.charCodeAt(p64 + 3) << 8 | this.memory.charCodeAt(p64 + 2), this.memory.charCodeAt(p64 + 5) << 8 | this.memory.charCodeAt(p64 + 4), this.memory.charCodeAt(p64 + 7) << 8 | this.memory.charCodeAt(p64 + 6));
1270
+ this.v2.add(other.multiply(PRIME64_2)).rotl(31).multiply(PRIME64_1);
1271
+ p64 += 8;
1272
+ other = UINT64(this.memory.charCodeAt(p64 + 1) << 8 | this.memory.charCodeAt(p64), this.memory.charCodeAt(p64 + 3) << 8 | this.memory.charCodeAt(p64 + 2), this.memory.charCodeAt(p64 + 5) << 8 | this.memory.charCodeAt(p64 + 4), this.memory.charCodeAt(p64 + 7) << 8 | this.memory.charCodeAt(p64 + 6));
1273
+ this.v3.add(other.multiply(PRIME64_2)).rotl(31).multiply(PRIME64_1);
1274
+ p64 += 8;
1275
+ other = UINT64(this.memory.charCodeAt(p64 + 1) << 8 | this.memory.charCodeAt(p64), this.memory.charCodeAt(p64 + 3) << 8 | this.memory.charCodeAt(p64 + 2), this.memory.charCodeAt(p64 + 5) << 8 | this.memory.charCodeAt(p64 + 4), this.memory.charCodeAt(p64 + 7) << 8 | this.memory.charCodeAt(p64 + 6));
1276
+ this.v4.add(other.multiply(PRIME64_2)).rotl(31).multiply(PRIME64_1);
1277
+ } else {
1278
+ var other = UINT64(this.memory[p64 + 1] << 8 | this.memory[p64], this.memory[p64 + 3] << 8 | this.memory[p64 + 2], this.memory[p64 + 5] << 8 | this.memory[p64 + 4], this.memory[p64 + 7] << 8 | this.memory[p64 + 6]);
1279
+ this.v1.add(other.multiply(PRIME64_2)).rotl(31).multiply(PRIME64_1);
1280
+ p64 += 8;
1281
+ other = UINT64(this.memory[p64 + 1] << 8 | this.memory[p64], this.memory[p64 + 3] << 8 | this.memory[p64 + 2], this.memory[p64 + 5] << 8 | this.memory[p64 + 4], this.memory[p64 + 7] << 8 | this.memory[p64 + 6]);
1282
+ this.v2.add(other.multiply(PRIME64_2)).rotl(31).multiply(PRIME64_1);
1283
+ p64 += 8;
1284
+ other = UINT64(this.memory[p64 + 1] << 8 | this.memory[p64], this.memory[p64 + 3] << 8 | this.memory[p64 + 2], this.memory[p64 + 5] << 8 | this.memory[p64 + 4], this.memory[p64 + 7] << 8 | this.memory[p64 + 6]);
1285
+ this.v3.add(other.multiply(PRIME64_2)).rotl(31).multiply(PRIME64_1);
1286
+ p64 += 8;
1287
+ other = UINT64(this.memory[p64 + 1] << 8 | this.memory[p64], this.memory[p64 + 3] << 8 | this.memory[p64 + 2], this.memory[p64 + 5] << 8 | this.memory[p64 + 4], this.memory[p64 + 7] << 8 | this.memory[p64 + 6]);
1288
+ this.v4.add(other.multiply(PRIME64_2)).rotl(31).multiply(PRIME64_1);
1289
+ }
1290
+ p += 32 - this.memsize;
1291
+ this.memsize = 0;
1292
+ if (isString) this.memory = "";
1293
+ }
1294
+ if (p <= bEnd - 32) {
1295
+ var limit = bEnd - 32;
1296
+ do {
1297
+ if (isString) {
1298
+ var other = UINT64(input.charCodeAt(p + 1) << 8 | input.charCodeAt(p), input.charCodeAt(p + 3) << 8 | input.charCodeAt(p + 2), input.charCodeAt(p + 5) << 8 | input.charCodeAt(p + 4), input.charCodeAt(p + 7) << 8 | input.charCodeAt(p + 6));
1299
+ this.v1.add(other.multiply(PRIME64_2)).rotl(31).multiply(PRIME64_1);
1300
+ p += 8;
1301
+ other = UINT64(input.charCodeAt(p + 1) << 8 | input.charCodeAt(p), input.charCodeAt(p + 3) << 8 | input.charCodeAt(p + 2), input.charCodeAt(p + 5) << 8 | input.charCodeAt(p + 4), input.charCodeAt(p + 7) << 8 | input.charCodeAt(p + 6));
1302
+ this.v2.add(other.multiply(PRIME64_2)).rotl(31).multiply(PRIME64_1);
1303
+ p += 8;
1304
+ other = UINT64(input.charCodeAt(p + 1) << 8 | input.charCodeAt(p), input.charCodeAt(p + 3) << 8 | input.charCodeAt(p + 2), input.charCodeAt(p + 5) << 8 | input.charCodeAt(p + 4), input.charCodeAt(p + 7) << 8 | input.charCodeAt(p + 6));
1305
+ this.v3.add(other.multiply(PRIME64_2)).rotl(31).multiply(PRIME64_1);
1306
+ p += 8;
1307
+ other = UINT64(input.charCodeAt(p + 1) << 8 | input.charCodeAt(p), input.charCodeAt(p + 3) << 8 | input.charCodeAt(p + 2), input.charCodeAt(p + 5) << 8 | input.charCodeAt(p + 4), input.charCodeAt(p + 7) << 8 | input.charCodeAt(p + 6));
1308
+ this.v4.add(other.multiply(PRIME64_2)).rotl(31).multiply(PRIME64_1);
1309
+ } else {
1310
+ var other = UINT64(input[p + 1] << 8 | input[p], input[p + 3] << 8 | input[p + 2], input[p + 5] << 8 | input[p + 4], input[p + 7] << 8 | input[p + 6]);
1311
+ this.v1.add(other.multiply(PRIME64_2)).rotl(31).multiply(PRIME64_1);
1312
+ p += 8;
1313
+ other = UINT64(input[p + 1] << 8 | input[p], input[p + 3] << 8 | input[p + 2], input[p + 5] << 8 | input[p + 4], input[p + 7] << 8 | input[p + 6]);
1314
+ this.v2.add(other.multiply(PRIME64_2)).rotl(31).multiply(PRIME64_1);
1315
+ p += 8;
1316
+ other = UINT64(input[p + 1] << 8 | input[p], input[p + 3] << 8 | input[p + 2], input[p + 5] << 8 | input[p + 4], input[p + 7] << 8 | input[p + 6]);
1317
+ this.v3.add(other.multiply(PRIME64_2)).rotl(31).multiply(PRIME64_1);
1318
+ p += 8;
1319
+ other = UINT64(input[p + 1] << 8 | input[p], input[p + 3] << 8 | input[p + 2], input[p + 5] << 8 | input[p + 4], input[p + 7] << 8 | input[p + 6]);
1320
+ this.v4.add(other.multiply(PRIME64_2)).rotl(31).multiply(PRIME64_1);
1321
+ }
1322
+ p += 8;
1323
+ } while (p <= limit);
1324
+ }
1325
+ if (p < bEnd) {
1326
+ if (isString) this.memory += input.slice(p);
1327
+ else if (isArrayBuffer) this.memory.set(input.subarray(p, bEnd), this.memsize);
1328
+ else input.copy(this.memory, this.memsize, p, bEnd);
1329
+ this.memsize = bEnd - p;
1330
+ }
1331
+ return this;
1332
+ };
1333
+ /**
1334
+ * Finalize the XXH64 computation. The XXH64 instance is ready for reuse for the given seed
1335
+ * @method digest
1336
+ * @return {UINT64} xxHash
1337
+ */
1338
+ XXH64.prototype.digest = function() {
1339
+ var input = this.memory;
1340
+ var isString = typeof input == "string";
1341
+ var p = 0;
1342
+ var bEnd = this.memsize;
1343
+ var h64, h;
1344
+ var u = new UINT64();
1345
+ if (this.total_len >= 32) {
1346
+ h64 = this.v1.clone().rotl(1);
1347
+ h64.add(this.v2.clone().rotl(7));
1348
+ h64.add(this.v3.clone().rotl(12));
1349
+ h64.add(this.v4.clone().rotl(18));
1350
+ h64.xor(this.v1.multiply(PRIME64_2).rotl(31).multiply(PRIME64_1));
1351
+ h64.multiply(PRIME64_1).add(PRIME64_4);
1352
+ h64.xor(this.v2.multiply(PRIME64_2).rotl(31).multiply(PRIME64_1));
1353
+ h64.multiply(PRIME64_1).add(PRIME64_4);
1354
+ h64.xor(this.v3.multiply(PRIME64_2).rotl(31).multiply(PRIME64_1));
1355
+ h64.multiply(PRIME64_1).add(PRIME64_4);
1356
+ h64.xor(this.v4.multiply(PRIME64_2).rotl(31).multiply(PRIME64_1));
1357
+ h64.multiply(PRIME64_1).add(PRIME64_4);
1358
+ } else h64 = this.seed.clone().add(PRIME64_5);
1359
+ h64.add(u.fromNumber(this.total_len));
1360
+ while (p <= bEnd - 8) {
1361
+ if (isString) u.fromBits(input.charCodeAt(p + 1) << 8 | input.charCodeAt(p), input.charCodeAt(p + 3) << 8 | input.charCodeAt(p + 2), input.charCodeAt(p + 5) << 8 | input.charCodeAt(p + 4), input.charCodeAt(p + 7) << 8 | input.charCodeAt(p + 6));
1362
+ else u.fromBits(input[p + 1] << 8 | input[p], input[p + 3] << 8 | input[p + 2], input[p + 5] << 8 | input[p + 4], input[p + 7] << 8 | input[p + 6]);
1363
+ u.multiply(PRIME64_2).rotl(31).multiply(PRIME64_1);
1364
+ h64.xor(u).rotl(27).multiply(PRIME64_1).add(PRIME64_4);
1365
+ p += 8;
1366
+ }
1367
+ if (p + 4 <= bEnd) {
1368
+ if (isString) u.fromBits(input.charCodeAt(p + 1) << 8 | input.charCodeAt(p), input.charCodeAt(p + 3) << 8 | input.charCodeAt(p + 2), 0, 0);
1369
+ else u.fromBits(input[p + 1] << 8 | input[p], input[p + 3] << 8 | input[p + 2], 0, 0);
1370
+ h64.xor(u.multiply(PRIME64_1)).rotl(23).multiply(PRIME64_2).add(PRIME64_3);
1371
+ p += 4;
1372
+ }
1373
+ while (p < bEnd) {
1374
+ u.fromBits(isString ? input.charCodeAt(p++) : input[p++], 0, 0, 0);
1375
+ h64.xor(u.multiply(PRIME64_5)).rotl(11).multiply(PRIME64_1);
1376
+ }
1377
+ h = h64.clone().shiftRight(33);
1378
+ h64.xor(h).multiply(PRIME64_2);
1379
+ h = h64.clone().shiftRight(29);
1380
+ h64.xor(h).multiply(PRIME64_3);
1381
+ h = h64.clone().shiftRight(32);
1382
+ h64.xor(h);
1383
+ this.init(this.seed);
1384
+ return h64;
1385
+ };
1386
+ module.exports = XXH64;
1387
+ }));
1388
+ //#endregion
102
1389
  //#region src/fhir-utils/fhirHashUtils.ts
1390
+ var import_lib = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
1391
+ module.exports = {
1392
+ h32: require_xxhash(),
1393
+ h64: require_xxhash64()
1394
+ };
1395
+ })))(), 1);
103
1396
  /**
104
1397
  * Normalize string values similar to HAPI FHIR (trim, collapse whitespace, lowercase)
105
1398
  */
106
1399
  function normalizeStringParam(input) {
107
1400
  return input.trim().replace(/\s+/g, " ").toLowerCase();
108
1401
  }
1402
+ function xxhash64Signed(input) {
1403
+ const hashHex = import_lib.default.h64(input, 43981).toString(16).padStart(16, "0");
1404
+ return Buffer.from(hashHex, "hex").readBigInt64BE(0);
1405
+ }
109
1406
  /**
110
1407
  * Converts first 64 bits of MurmurHash3_x64_128 result into signed BigInt
111
1408
  */
112
- function murmur64Signed(input) {
113
- const hex128 = murmurhash3js.x64.hash128(input);
114
- return Buffer.from(hex128.slice(0, 16), "hex").readBigInt64LE(0);
115
- }
116
1409
  /**
117
1410
  * Compute hash for a normalized string search parameter
118
1411
  */
119
1412
  function hashStringParam(input, normalize) {
120
- if (normalize === true) return murmur64Signed(normalizeStringParam(input));
121
- else return murmur64Signed(input);
1413
+ if (normalize === true) return xxhash64Signed(normalizeStringParam(input));
1414
+ else return xxhash64Signed(input);
122
1415
  }
123
1416
  /**
124
1417
  * Compute hash for a token search parameter (system|code)
125
1418
  */
126
1419
  function hashTokenParam({ system, code }) {
127
- return murmur64Signed((system ?? "") + "|" + code);
1420
+ return xxhash64Signed((system ?? "") + "|" + code);
128
1421
  }
129
1422
  /**
130
1423
  * Compute hash for a reference search parameter
131
1424
  * Case-sensitive and used as-is
132
1425
  */
133
1426
  function hashReferenceParam(reference) {
134
- return murmur64Signed(reference);
1427
+ return xxhash64Signed(reference);
135
1428
  }
136
1429
  /**
137
1430
  * Compute hash for a URI parameter (optionally lowercased)
138
1431
  */
139
1432
  function hashUriParam(uri, lowercase = false) {
140
- return murmur64Signed(lowercase ? uri.toLowerCase() : uri);
1433
+ return xxhash64Signed(lowercase ? uri.toLowerCase() : uri);
141
1434
  }
142
1435
  //#endregion
143
1436
  //#region src/redisDistributedLock.ts
@@ -3251,7 +4544,7 @@ exports.hashReferenceParam = hashReferenceParam;
3251
4544
  exports.hashStringParam = hashStringParam;
3252
4545
  exports.hashTokenParam = hashTokenParam;
3253
4546
  exports.hashUriParam = hashUriParam;
3254
- exports.murmur64Signed = murmur64Signed;
3255
4547
  exports.normalizeStringParam = normalizeStringParam;
4548
+ exports.xxhash64Signed = xxhash64Signed;
3256
4549
 
3257
4550
  //# sourceMappingURL=index.cjs.map