dns-message 1.0.1-canary-197f34977c71a09b51a96f1a99eb26e7aa8186a5 → 1.0.1-canary-de720c7dcdc03fb7dc3f7b6f6df698ba0169f9d8

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.
@@ -218,6 +218,20 @@ const f = {
218
218
  };
219
219
 
220
220
  const d = {
221
+ bytes: t => t.byteLength + 1,
222
+ write(t, e, n) {
223
+ t.setUint8(e++, n.byteLength);
224
+ new Uint8Array(t.buffer, t.byteOffset + e, n.byteLength).set(n);
225
+ return e += n.byteLength;
226
+ },
227
+ read(t, e) {
228
+ const n = t.getUint8(e.offset);
229
+ advance(e, 1);
230
+ return sliceView(t, e, n);
231
+ }
232
+ };
233
+
234
+ const u = {
221
235
  bytes: t => o(t) + 1,
222
236
  write(t, e, n) {
223
237
  const r = a.encode(n);
@@ -231,7 +245,7 @@ const d = {
231
245
  }
232
246
  };
233
247
 
234
- const u = {
248
+ const l = {
235
249
  bytes(t) {
236
250
  const e = [];
237
251
  for (let n = 0; n < t.length; n++) {
@@ -282,7 +296,7 @@ const u = {
282
296
  }
283
297
  };
284
298
 
285
- const l = {
299
+ const g = {
286
300
  bytes: () => 4,
287
301
  write(t, e, n) {
288
302
  const r = n.split(".", 4);
@@ -299,7 +313,7 @@ const l = {
299
313
  }
300
314
  };
301
315
 
302
- const g = {
316
+ const y = {
303
317
  bytes: () => 2,
304
318
  write(t, e, n) {
305
319
  t.setUint16(e, n);
@@ -312,7 +326,7 @@ const g = {
312
326
  }
313
327
  };
314
328
 
315
- const y = {
329
+ const h = {
316
330
  bytes: () => 16,
317
331
  write(t, e, n) {
318
332
  const r = n.indexOf("::");
@@ -410,7 +424,7 @@ const sliceView = (t, e, n = e.length) => {
410
424
 
411
425
  const U = 32768;
412
426
 
413
- const h = {
427
+ const w = {
414
428
  bytes: t => c.bytes(t.name) + 4,
415
429
  write(t, e, r) {
416
430
  let s = r.class || n.IN;
@@ -441,7 +455,7 @@ const h = {
441
455
  }
442
456
  };
443
457
 
444
- let w = function(t) {
458
+ let b = function(t) {
445
459
  t[t.v4 = 1] = "v4";
446
460
  t[t.v6 = 2] = "v6";
447
461
  return t;
@@ -456,16 +470,16 @@ const E = withRDLength({
456
470
  })
457
471
  });
458
472
 
459
- const b = "(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])";
473
+ const A = "(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])";
460
474
 
461
- const A = new RegExp(`^${`(?:${b}\\.){3}${b}`}$`);
475
+ const p = new RegExp(`^${`(?:${A}\\.){3}${A}`}$`);
462
476
 
463
- const p = withRDLength({
477
+ const N = withRDLength({
464
478
  bytes: t => Math.ceil((t.sourcePrefixLength || 0) / 8) + 4,
465
479
  write(t, e, n) {
466
480
  const r = n.sourcePrefixLength || 0;
467
481
  const s = n.scopePrefixLength || 0;
468
- const a = n.family || (A.test(n.ip) ? w.v4 : w.v6);
482
+ const a = n.family || (p.test(n.ip) ? b.v4 : b.v6);
469
483
  const i = Math.ceil(r / 8);
470
484
  t.setUint16(e, a);
471
485
  t.setUint8(e + 2, r);
@@ -475,7 +489,7 @@ const p = withRDLength({
475
489
  const n = new ArrayBuffer(t.bytes(e));
476
490
  const r = t.write(new DataView(n), 0, e);
477
491
  return new Uint8Array(n, 0, r);
478
- })(a === w.v4 ? l : y, n.ip);
492
+ })(a === b.v4 ? g : h, n.ip);
479
493
  for (let n = 0; n < i; n++) {
480
494
  t.setUint8(e++, o[n]);
481
495
  }
@@ -491,12 +505,12 @@ const p = withRDLength({
491
505
  family: n,
492
506
  sourcePrefixLength: r,
493
507
  scopePrefixLength: a,
494
- ip: n === w.v4 ? l.read(t, e) : y.read(t, e)
508
+ ip: n === b.v4 ? g.read(t, e) : h.read(t, e)
495
509
  };
496
510
  }
497
511
  });
498
512
 
499
- const N = withRDLength({
513
+ const S = withRDLength({
500
514
  bytes: t => t.timeout ? 2 : 0,
501
515
  write(t, e, n) {
502
516
  if (n.timeout) {
@@ -522,7 +536,7 @@ const N = withRDLength({
522
536
  }
523
537
  });
524
538
 
525
- const S = withRDLength({
539
+ const T = withRDLength({
526
540
  bytes: t => t.length || 0,
527
541
  write: (t, e, n) => e + (n.length || 0),
528
542
  read(t, e) {
@@ -535,7 +549,7 @@ const S = withRDLength({
535
549
  }
536
550
  });
537
551
 
538
- const T = withRDLength({
552
+ const I = withRDLength({
539
553
  bytes: t => 2 * t.tags.length,
540
554
  write(t, e, n) {
541
555
  for (let r = 0; r < n.tags.length; r++) {
@@ -560,23 +574,23 @@ const T = withRDLength({
560
574
 
561
575
  const isUnknownOpt = t => !!t.data;
562
576
 
563
- const I = {
577
+ const P = {
564
578
  bytes(t) {
565
579
  if (isUnknownOpt(t)) {
566
580
  return E.bytes(t) + 2;
567
581
  }
568
582
  switch (t.code) {
569
583
  case s.CLIENT_SUBNET:
570
- return p.bytes(t) + 2;
584
+ return N.bytes(t) + 2;
571
585
 
572
586
  case s.TCP_KEEPALIVE:
573
- return N.bytes(t) + 2;
587
+ return S.bytes(t) + 2;
574
588
 
575
589
  case s.PADDING:
576
- return S.bytes(t) + 2;
590
+ return T.bytes(t) + 2;
577
591
 
578
592
  case s.KEY_TAG:
579
- return T.bytes(t) + 2;
593
+ return I.bytes(t) + 2;
580
594
  }
581
595
  },
582
596
  write(t, e, n) {
@@ -587,16 +601,16 @@ const I = {
587
601
  }
588
602
  switch (n.code) {
589
603
  case s.CLIENT_SUBNET:
590
- return p.write(t, e, n);
604
+ return N.write(t, e, n);
591
605
 
592
606
  case s.TCP_KEEPALIVE:
593
- return N.write(t, e, n);
607
+ return S.write(t, e, n);
594
608
 
595
609
  case s.PADDING:
596
- return S.write(t, e, n);
610
+ return T.write(t, e, n);
597
611
 
598
612
  case s.KEY_TAG:
599
- return T.write(t, e, n);
613
+ return I.write(t, e, n);
600
614
  }
601
615
  },
602
616
  read(t, e) {
@@ -604,16 +618,16 @@ const I = {
604
618
  advance(e, 2);
605
619
  switch (n) {
606
620
  case s.CLIENT_SUBNET:
607
- return p.read(t, e);
621
+ return N.read(t, e);
608
622
 
609
623
  case s.TCP_KEEPALIVE:
610
- return N.read(t, e);
624
+ return S.read(t, e);
611
625
 
612
626
  case s.PADDING:
613
- return S.read(t, e);
627
+ return T.read(t, e);
614
628
 
615
629
  case s.KEY_TAG:
616
- return T.read(t, e);
630
+ return I.read(t, e);
617
631
 
618
632
  default:
619
633
  const r = E.read(t, e);
@@ -623,7 +637,7 @@ const I = {
623
637
  }
624
638
  };
625
639
 
626
- let P = function(t) {
640
+ let R = function(t) {
627
641
  t[t.Mandatory = 0] = "Mandatory";
628
642
  t[t.Alpn = 1] = "Alpn";
629
643
  t[t.NoDefaultAlpn = 2] = "NoDefaultAlpn";
@@ -636,86 +650,86 @@ let P = function(t) {
636
650
  return t;
637
651
  }({});
638
652
 
639
- const R = withRDLength(array(g));
653
+ const D = withRDLength(array(y));
640
654
 
641
- const D = withRDLength(array(d));
655
+ const C = withRDLength(array(u));
642
656
 
643
- const C = withRDLength(g);
657
+ const m = withRDLength(y);
644
658
 
645
- const m = withRDLength(array(l));
659
+ const O = withRDLength(array(g));
646
660
 
647
- const O = withRDLength(array(y));
661
+ const L = withRDLength(array(h));
648
662
 
649
- const L = withRDLength(f);
663
+ const v = withRDLength(f);
650
664
 
651
- const v = {
665
+ const H = {
652
666
  bytes(t) {
653
667
  let e = 0;
654
668
  if (null != t.mandatory) {
655
- e += R.bytes(t.mandatory) + 2;
669
+ e += D.bytes(t.mandatory) + 2;
656
670
  }
657
671
  if (null != t.alpn) {
658
- e += D.bytes(t.alpn) + 2;
672
+ e += C.bytes(t.alpn) + 2;
659
673
  }
660
674
  if (t["no-default-alpn"]) {
661
675
  e += 4;
662
676
  }
663
677
  if (null != t.port) {
664
- e += C.bytes(t.port) + 2;
678
+ e += m.bytes(t.port) + 2;
665
679
  }
666
680
  if (t.ipv4hint) {
667
- e += m.bytes(t.ipv4hint) + 2;
681
+ e += O.bytes(t.ipv4hint) + 2;
668
682
  }
669
683
  if (t.ipv6hint) {
670
- e += O.bytes(t.ipv6hint) + 2;
684
+ e += L.bytes(t.ipv6hint) + 2;
671
685
  }
672
686
  if (t.echconfig) {
673
- e += L.bytes(t.echconfig) + 2;
687
+ e += v.bytes(t.echconfig) + 2;
674
688
  }
675
689
  if (t.dohpath) {
676
- e += L.bytes(t.dohpath) + 2;
690
+ e += v.bytes(t.dohpath) + 2;
677
691
  }
678
692
  if (t.odoh) {
679
- e += L.bytes(t.odoh) + 2;
693
+ e += v.bytes(t.odoh) + 2;
680
694
  }
681
695
  return e;
682
696
  },
683
697
  write(t, e, n) {
684
698
  if (null != n.mandatory) {
685
- t.setUint16(e, P.Mandatory);
686
- e = R.write(t, e + 2, n.mandatory);
699
+ t.setUint16(e, R.Mandatory);
700
+ e = D.write(t, e + 2, n.mandatory);
687
701
  }
688
702
  if (null != n.alpn) {
689
- t.setUint16(e, P.Alpn);
690
- e = D.write(t, e + 2, n.alpn);
703
+ t.setUint16(e, R.Alpn);
704
+ e = C.write(t, e + 2, n.alpn);
691
705
  }
692
706
  if (n["no-default-alpn"]) {
693
- t.setUint16(e, P.NoDefaultAlpn);
707
+ t.setUint16(e, R.NoDefaultAlpn);
694
708
  e += 4;
695
709
  }
696
710
  if (null != n.port) {
697
- t.setUint16(e, P.Port);
698
- e = C.write(t, e + 2, n.port);
711
+ t.setUint16(e, R.Port);
712
+ e = m.write(t, e + 2, n.port);
699
713
  }
700
714
  if (n.ipv4hint) {
701
- t.setUint16(e, P.Ipv4Hint);
702
- e = m.write(t, e + 2, n.ipv4hint);
715
+ t.setUint16(e, R.Ipv4Hint);
716
+ e = O.write(t, e + 2, n.ipv4hint);
703
717
  }
704
718
  if (n.ipv6hint) {
705
- t.setUint16(e, P.Ipv6Hint);
706
- e = O.write(t, e + 2, n.ipv6hint);
719
+ t.setUint16(e, R.Ipv6Hint);
720
+ e = L.write(t, e + 2, n.ipv6hint);
707
721
  }
708
722
  if (n.echconfig) {
709
- t.setUint16(e, P.EchConfig);
710
- e = L.write(t, e + 2, n.echconfig);
723
+ t.setUint16(e, R.EchConfig);
724
+ e = v.write(t, e + 2, n.echconfig);
711
725
  }
712
726
  if (n.dohpath) {
713
- t.setUint16(e, P.DohPath);
714
- e = L.write(t, e + 2, n.dohpath);
727
+ t.setUint16(e, R.DohPath);
728
+ e = v.write(t, e + 2, n.dohpath);
715
729
  }
716
730
  if (n.odoh) {
717
- t.setUint16(e, P.Odoh);
718
- e = L.write(t, e + 2, n.odoh);
731
+ t.setUint16(e, R.Odoh);
732
+ e = v.write(t, e + 2, n.odoh);
719
733
  }
720
734
  return e;
721
735
  },
@@ -736,62 +750,62 @@ const v = {
736
750
  const n = t.getUint16(e.offset);
737
751
  advance(e, 2);
738
752
  switch (n) {
739
- case P.Mandatory:
740
- s.mandatory = R.read(t, e);
753
+ case R.Mandatory:
754
+ s.mandatory = D.read(t, e);
741
755
  break;
742
756
 
743
- case P.Alpn:
744
- s.alpn = D.read(t, e);
757
+ case R.Alpn:
758
+ s.alpn = C.read(t, e);
745
759
  break;
746
760
 
747
- case P.NoDefaultAlpn:
761
+ case R.NoDefaultAlpn:
748
762
  s["no-default-alpn"] = !0;
749
763
  advance(e, 2);
750
764
  break;
751
765
 
752
- case P.Port:
753
- s.port = C.read(t, e);
766
+ case R.Port:
767
+ s.port = m.read(t, e);
754
768
  break;
755
769
 
756
- case P.Ipv4Hint:
757
- s.ipv4hint = m.read(t, e);
770
+ case R.Ipv4Hint:
771
+ s.ipv4hint = O.read(t, e);
758
772
  break;
759
773
 
760
- case P.Ipv6Hint:
761
- s.ipv6hint = O.read(t, e);
774
+ case R.Ipv6Hint:
775
+ s.ipv6hint = L.read(t, e);
762
776
  break;
763
777
 
764
- case P.EchConfig:
765
- s.echconfig = L.read(t, e);
778
+ case R.EchConfig:
779
+ s.echconfig = v.read(t, e);
766
780
  break;
767
781
 
768
- case P.DohPath:
769
- s.dohpath = i.decode(L.read(t, e));
782
+ case R.DohPath:
783
+ s.dohpath = i.decode(v.read(t, e));
770
784
  break;
771
785
 
772
- case P.Odoh:
773
- s.odoh = L.read(t, e);
786
+ case R.Odoh:
787
+ s.odoh = v.read(t, e);
774
788
  break;
775
789
 
776
790
  default:
777
- L.read(t, e);
791
+ v.read(t, e);
778
792
  }
779
793
  }
780
794
  return s;
781
795
  }
782
796
  };
783
797
 
784
- const H = withRDLength(f);
798
+ const x = withRDLength(f);
785
799
 
786
- const x = withRDLength(c);
800
+ const _ = withRDLength(c);
787
801
 
788
- const _ = withRDLength(l);
802
+ const M = withRDLength(g);
789
803
 
790
- const M = withRDLength(y);
804
+ const V = withRDLength(h);
791
805
 
792
- const V = withRDLength(array(d));
806
+ const Y = withRDLength(array(u));
793
807
 
794
- const Y = withRDLength({
808
+ const K = withRDLength({
795
809
  bytes: t => c.bytes(t.target) + 6,
796
810
  write(t, e, n) {
797
811
  t.setUint16(e, n.priority || 0);
@@ -815,15 +829,15 @@ const Y = withRDLength({
815
829
  }
816
830
  });
817
831
 
818
- const K = withRDLength({
819
- bytes: t => d.bytes(t.cpu) + d.bytes(t.os),
832
+ const X = withRDLength({
833
+ bytes: t => u.bytes(t.cpu) + u.bytes(t.os),
820
834
  write(t, e, n) {
821
- e = d.write(t, e, n.cpu);
822
- return e = d.write(t, e, n.os);
835
+ e = u.write(t, e, n.cpu);
836
+ return e = u.write(t, e, n.os);
823
837
  },
824
838
  read: (t, e) => ({
825
- cpu: d.read(t, e),
826
- os: d.read(t, e)
839
+ cpu: u.read(t, e),
840
+ os: u.read(t, e)
827
841
  })
828
842
  });
829
843
 
@@ -839,15 +853,15 @@ const toCaaTag = t => {
839
853
  }
840
854
  };
841
855
 
842
- const X = withRDLength({
843
- bytes: t => d.bytes(t.tag) + f.bytes(t.value) + 1,
856
+ const F = withRDLength({
857
+ bytes: t => u.bytes(t.tag) + f.bytes(t.value) + 1,
844
858
  write(t, e, n) {
845
859
  let r = n.flags || 0;
846
860
  if (n.issuerCritical) {
847
861
  r = 128;
848
862
  }
849
863
  t.setUint8(e, r);
850
- e = d.write(t, e + 1, n.tag);
864
+ e = u.write(t, e + 1, n.tag);
851
865
  return e = f.write(t, e, n.value);
852
866
  },
853
867
  read(t, e) {
@@ -855,14 +869,14 @@ const X = withRDLength({
855
869
  advance(e, 1);
856
870
  return {
857
871
  flags: n,
858
- tag: toCaaTag(d.read(t, e)),
872
+ tag: toCaaTag(u.read(t, e)),
859
873
  value: f.read(t, e),
860
874
  issuerCritical: !!(128 & n)
861
875
  };
862
876
  }
863
877
  });
864
878
 
865
- const F = withRDLength({
879
+ const G = withRDLength({
866
880
  bytes: t => c.bytes(t.mname) + c.bytes(t.rname) + 20,
867
881
  write(t, e, n) {
868
882
  e = c.write(t, e, n.mname);
@@ -890,7 +904,7 @@ const F = withRDLength({
890
904
  }
891
905
  });
892
906
 
893
- const G = withRDLength({
907
+ const B = withRDLength({
894
908
  bytes: t => c.bytes(t.exchange) + 2,
895
909
  write(t, e, n) {
896
910
  t.setUint16(e, n.preference || 0);
@@ -907,7 +921,7 @@ const G = withRDLength({
907
921
  }
908
922
  });
909
923
 
910
- const B = withRDLength({
924
+ const k = withRDLength({
911
925
  bytes: t => f.bytes(t.key) + 4,
912
926
  write(t, e, n) {
913
927
  t.setUint16(e, n.flags);
@@ -927,7 +941,7 @@ const B = withRDLength({
927
941
  }
928
942
  });
929
943
 
930
- const k = withRDLength({
944
+ const $ = withRDLength({
931
945
  bytes: t => 18 + c.bytes(t.signersName) + f.bytes(t.signature),
932
946
  write(t, e, n) {
933
947
  t.setUint16(e, n.typeCovered);
@@ -963,7 +977,7 @@ const k = withRDLength({
963
977
  }
964
978
  });
965
979
 
966
- const $ = withRDLength({
980
+ const q = withRDLength({
967
981
  bytes: t => c.bytes(t.mbox) + c.bytes(t.txt),
968
982
  write(t, e, n) {
969
983
  e = c.write(t, e, n.mbox);
@@ -975,27 +989,27 @@ const $ = withRDLength({
975
989
  })
976
990
  });
977
991
 
978
- const q = withRDLength({
979
- bytes: t => c.bytes(t.nextDomain) + u.bytes(t.rrtypes),
992
+ const Q = withRDLength({
993
+ bytes: t => c.bytes(t.nextDomain) + l.bytes(t.rrtypes),
980
994
  write(t, e, n) {
981
995
  e = c.write(t, e, n.nextDomain);
982
- return e = u.write(t, e, n.rrtypes);
996
+ return e = l.write(t, e, n.rrtypes);
983
997
  },
984
998
  read: (t, e) => ({
985
999
  nextDomain: c.read(t, e),
986
- rrtypes: u.read(t, e)
1000
+ rrtypes: l.read(t, e)
987
1001
  })
988
1002
  });
989
1003
 
990
- const Q = withRDLength({
991
- bytes: t => d.bytes(t.salt) + d.bytes(t.nextDomain) + u.bytes(t.rrtypes) + 4,
1004
+ const j = withRDLength({
1005
+ bytes: t => d.bytes(t.salt) + d.bytes(t.nextDomain) + l.bytes(t.rrtypes) + 4,
992
1006
  write(t, e, n) {
993
1007
  t.setUint8(e, n.algorithm);
994
1008
  t.setUint8(e + 1, n.flags);
995
1009
  t.setUint16(e + 2, n.iterations);
996
1010
  e = d.write(t, e + 4, n.salt);
997
1011
  e = d.write(t, e, n.nextDomain);
998
- return e = u.write(t, e, n.rrtypes);
1012
+ return e = l.write(t, e, n.rrtypes);
999
1013
  },
1000
1014
  read(t, e) {
1001
1015
  const n = t.getUint8(e.offset);
@@ -1008,12 +1022,12 @@ const Q = withRDLength({
1008
1022
  iterations: s,
1009
1023
  salt: d.read(t, e),
1010
1024
  nextDomain: d.read(t, e),
1011
- rrtypes: u.read(t, e)
1025
+ rrtypes: l.read(t, e)
1012
1026
  };
1013
1027
  }
1014
1028
  });
1015
1029
 
1016
- const j = withRDLength({
1030
+ const z = withRDLength({
1017
1031
  bytes: t => f.bytes(t.fingerprint) + 2,
1018
1032
  write(t, e, n) {
1019
1033
  t.setUint8(e, n.algorithm);
@@ -1032,7 +1046,7 @@ const j = withRDLength({
1032
1046
  }
1033
1047
  });
1034
1048
 
1035
- const z = withRDLength({
1049
+ const W = withRDLength({
1036
1050
  bytes: t => f.bytes(t.digest) + 4,
1037
1051
  write(t, e, n) {
1038
1052
  t.setUint16(e, n.keyTag);
@@ -1054,14 +1068,14 @@ const z = withRDLength({
1054
1068
  }
1055
1069
  });
1056
1070
 
1057
- const W = withRDLength({
1058
- bytes: t => d.bytes(t.flags) + d.bytes(t.services) + d.bytes(t.regexp) + c.bytes(t.replacement) + 4,
1071
+ const Z = withRDLength({
1072
+ bytes: t => u.bytes(t.flags) + u.bytes(t.services) + u.bytes(t.regexp) + c.bytes(t.replacement) + 4,
1059
1073
  write(t, e, n) {
1060
1074
  t.setUint16(e, n.order);
1061
1075
  t.setUint16(e + 2, n.preference);
1062
- e = d.write(t, e + 4, n.flags);
1063
- e = d.write(t, e, n.services);
1064
- e = d.write(t, e, n.regexp);
1076
+ e = u.write(t, e + 4, n.flags);
1077
+ e = u.write(t, e, n.services);
1078
+ e = u.write(t, e, n.regexp);
1065
1079
  return e = c.write(t, e, n.replacement);
1066
1080
  },
1067
1081
  read(t, e) {
@@ -1071,15 +1085,15 @@ const W = withRDLength({
1071
1085
  return {
1072
1086
  order: n,
1073
1087
  preference: r,
1074
- flags: d.read(t, e),
1075
- services: d.read(t, e),
1076
- regexp: d.read(t, e),
1088
+ flags: u.read(t, e),
1089
+ services: u.read(t, e),
1090
+ regexp: u.read(t, e),
1077
1091
  replacement: c.read(t, e)
1078
1092
  };
1079
1093
  }
1080
1094
  });
1081
1095
 
1082
- const Z = withRDLength({
1096
+ const J = withRDLength({
1083
1097
  bytes: t => f.bytes(t.certificate) + 3,
1084
1098
  write(t, e, n) {
1085
1099
  t.setUint8(e, n.usage);
@@ -1101,12 +1115,12 @@ const Z = withRDLength({
1101
1115
  }
1102
1116
  });
1103
1117
 
1104
- const J = withRDLength({
1105
- bytes: t => c.bytes(t.name) + v.bytes(t.params) + 2,
1118
+ const tt = withRDLength({
1119
+ bytes: t => c.bytes(t.name) + H.bytes(t.params) + 2,
1106
1120
  write(t, e, n) {
1107
1121
  t.setUint16(e, n.priority || 0);
1108
1122
  e = c.write(t, e + 2, n.name);
1109
- return e = v.write(t, e, n.params);
1123
+ return e = H.write(t, e, n.params);
1110
1124
  },
1111
1125
  read(t, e) {
1112
1126
  const n = t.getUint16(e.offset);
@@ -1114,87 +1128,87 @@ const J = withRDLength({
1114
1128
  return {
1115
1129
  name: c.read(t, e),
1116
1130
  priority: n,
1117
- params: v.read(t, e)
1131
+ params: H.read(t, e)
1118
1132
  };
1119
1133
  }
1120
1134
  });
1121
1135
 
1122
- const tt = withRDLength(array(I));
1136
+ const et = withRDLength(array(P));
1123
1137
 
1124
- const et = 32768;
1138
+ const nt = 32768;
1125
1139
 
1126
- const nt = {
1140
+ const rt = {
1127
1141
  bytes(t) {
1128
1142
  const n = 8 + c.bytes(t.type === e.OPT ? "." : t.name);
1129
1143
  switch (t.type) {
1130
1144
  case e.A:
1131
- return n + _.bytes(t.data);
1145
+ return n + M.bytes(t.data);
1132
1146
 
1133
1147
  case e.NS:
1134
- return n + x.bytes(t.data);
1148
+ return n + _.bytes(t.data);
1135
1149
 
1136
1150
  case e.SOA:
1137
- return n + F.bytes(t.data);
1151
+ return n + G.bytes(t.data);
1138
1152
 
1139
1153
  case e.HINFO:
1140
- return n + K.bytes(t.data);
1154
+ return n + X.bytes(t.data);
1141
1155
 
1142
1156
  case e.MX:
1143
- return n + G.bytes(t.data);
1157
+ return n + B.bytes(t.data);
1144
1158
 
1145
1159
  case e.TXT:
1146
- return n + V.bytes(t.data);
1160
+ return n + Y.bytes(t.data);
1147
1161
 
1148
1162
  case e.RP:
1149
- return n + $.bytes(t.data);
1163
+ return n + q.bytes(t.data);
1150
1164
 
1151
1165
  case e.AAAA:
1152
- return n + M.bytes(t.data);
1166
+ return n + V.bytes(t.data);
1153
1167
 
1154
1168
  case e.SRV:
1155
- return n + Y.bytes(t.data);
1169
+ return n + K.bytes(t.data);
1156
1170
 
1157
1171
  case e.NAPTR:
1158
- return n + W.bytes(t.data);
1172
+ return n + Z.bytes(t.data);
1159
1173
 
1160
1174
  case e.OPT:
1161
- return n + tt.bytes(t.data);
1175
+ return n + et.bytes(t.data);
1162
1176
 
1163
1177
  case e.DS:
1164
- return n + z.bytes(t.data);
1178
+ return n + W.bytes(t.data);
1165
1179
 
1166
1180
  case e.SSHFP:
1167
- return n + j.bytes(t.data);
1181
+ return n + z.bytes(t.data);
1168
1182
 
1169
1183
  case e.RRSIG:
1170
- return n + k.bytes(t.data);
1184
+ return n + $.bytes(t.data);
1171
1185
 
1172
1186
  case e.NSEC:
1173
- return n + q.bytes(t.data);
1187
+ return n + Q.bytes(t.data);
1174
1188
 
1175
1189
  case e.DNSKEY:
1176
- return n + B.bytes(t.data);
1190
+ return n + k.bytes(t.data);
1177
1191
 
1178
1192
  case e.NSEC3:
1179
- return n + Q.bytes(t.data);
1193
+ return n + j.bytes(t.data);
1180
1194
 
1181
1195
  case e.TLSA:
1182
- return n + Z.bytes(t.data);
1196
+ return n + J.bytes(t.data);
1183
1197
 
1184
1198
  case e.SVCB:
1185
1199
  case e.HTTPS:
1186
- return n + J.bytes(t.data);
1200
+ return n + tt.bytes(t.data);
1187
1201
 
1188
1202
  case e.CAA:
1189
- return n + X.bytes(t.data);
1203
+ return n + F.bytes(t.data);
1190
1204
 
1191
1205
  case e.PTR:
1192
1206
  case e.CNAME:
1193
1207
  case e.DNAME:
1194
- return n + x.bytes(t.data);
1208
+ return n + _.bytes(t.data);
1195
1209
 
1196
1210
  default:
1197
- return n + H.bytes(t.data);
1211
+ return n + x.bytes(t.data);
1198
1212
  }
1199
1213
  },
1200
1214
  write(t, n, r) {
@@ -1205,79 +1219,79 @@ const nt = {
1205
1219
  t.setUint8(n + 4, r.extendedRcode || 0);
1206
1220
  t.setUint8(n + 5, r.ednsVersion || 0);
1207
1221
  t.setUint16(n + 6, r.flags || 0);
1208
- return tt.write(t, n += 8, r.data);
1222
+ return et.write(t, n += 8, r.data);
1209
1223
  }
1210
1224
  n = c.write(t, n, r.name);
1211
1225
  t.setUint16(n, r.type);
1212
- t.setUint16(n + 2, (r.class || 0) | (r.flush ? et : 0));
1226
+ t.setUint16(n + 2, (r.class || 0) | (r.flush ? nt : 0));
1213
1227
  t.setUint32(n + 4, r.ttl || 0);
1214
1228
  n += 8;
1215
1229
  switch (r.type) {
1216
1230
  case e.A:
1217
- return _.write(t, n, r.data);
1231
+ return M.write(t, n, r.data);
1218
1232
 
1219
1233
  case e.NS:
1220
- return x.write(t, n, r.data);
1234
+ return _.write(t, n, r.data);
1221
1235
 
1222
1236
  case e.SOA:
1223
- return F.write(t, n, r.data);
1237
+ return G.write(t, n, r.data);
1224
1238
 
1225
1239
  case e.HINFO:
1226
- return K.write(t, n, r.data);
1240
+ return X.write(t, n, r.data);
1227
1241
 
1228
1242
  case e.MX:
1229
- return G.write(t, n, r.data);
1243
+ return B.write(t, n, r.data);
1230
1244
 
1231
1245
  case e.TXT:
1232
- return V.write(t, n, r.data);
1246
+ return Y.write(t, n, r.data);
1233
1247
 
1234
1248
  case e.RP:
1235
- return $.write(t, n, r.data);
1249
+ return q.write(t, n, r.data);
1236
1250
 
1237
1251
  case e.AAAA:
1238
- return M.write(t, n, r.data);
1252
+ return V.write(t, n, r.data);
1239
1253
 
1240
1254
  case e.SRV:
1241
- return Y.write(t, n, r.data);
1255
+ return K.write(t, n, r.data);
1242
1256
 
1243
1257
  case e.NAPTR:
1244
- return W.write(t, n, r.data);
1258
+ return Z.write(t, n, r.data);
1245
1259
 
1246
1260
  case e.DS:
1247
- return z.write(t, n, r.data);
1261
+ return W.write(t, n, r.data);
1248
1262
 
1249
1263
  case e.SSHFP:
1250
- return j.write(t, n, r.data);
1264
+ return z.write(t, n, r.data);
1251
1265
 
1252
1266
  case e.RRSIG:
1253
- return k.write(t, n, r.data);
1267
+ return $.write(t, n, r.data);
1254
1268
 
1255
1269
  case e.NSEC:
1256
- return q.write(t, n, r.data);
1270
+ return Q.write(t, n, r.data);
1257
1271
 
1258
1272
  case e.DNSKEY:
1259
- return B.write(t, n, r.data);
1273
+ return k.write(t, n, r.data);
1260
1274
 
1261
1275
  case e.NSEC3:
1262
- return Q.write(t, n, r.data);
1276
+ return j.write(t, n, r.data);
1263
1277
 
1264
1278
  case e.TLSA:
1265
- return Z.write(t, n, r.data);
1279
+ return J.write(t, n, r.data);
1266
1280
 
1267
1281
  case e.SVCB:
1268
1282
  case e.HTTPS:
1269
- return J.write(t, n, r.data);
1283
+ return tt.write(t, n, r.data);
1270
1284
 
1271
1285
  case e.CAA:
1272
- return X.write(t, n, r.data);
1286
+ return F.write(t, n, r.data);
1273
1287
 
1274
1288
  case e.PTR:
1275
1289
  case e.CNAME:
1276
1290
  case e.DNAME:
1277
- return x.write(t, n, r.data);
1291
+ return _.write(t, n, r.data);
1278
1292
 
1279
1293
  default:
1280
- return H.write(t, n, r.data);
1294
+ return x.write(t, n, r.data);
1281
1295
  }
1282
1296
  },
1283
1297
  read(t, n) {
@@ -1295,7 +1309,7 @@ const nt = {
1295
1309
  extendedRcode: r,
1296
1310
  ednsVersion: a,
1297
1311
  flags: i,
1298
- data: tt.read(t, n)
1312
+ data: et.read(t, n)
1299
1313
  };
1300
1314
  }
1301
1315
  const a = t.getUint16(n.offset + 2);
@@ -1305,96 +1319,96 @@ const nt = {
1305
1319
  name: r,
1306
1320
  type: s,
1307
1321
  class: -32769 & a,
1308
- flush: !!(a & et),
1322
+ flush: !!(a & nt),
1309
1323
  ttl: i,
1310
1324
  data: null
1311
1325
  };
1312
1326
  switch (o.type) {
1313
1327
  case e.A:
1314
- o.data = _.read(t, n);
1328
+ o.data = M.read(t, n);
1315
1329
  return o;
1316
1330
 
1317
1331
  case e.NS:
1318
- o.data = x.read(t, n);
1332
+ o.data = _.read(t, n);
1319
1333
  return o;
1320
1334
 
1321
1335
  case e.SOA:
1322
- o.data = F.read(t, n);
1336
+ o.data = G.read(t, n);
1323
1337
  return o;
1324
1338
 
1325
1339
  case e.HINFO:
1326
- o.data = K.read(t, n);
1340
+ o.data = X.read(t, n);
1327
1341
  return o;
1328
1342
 
1329
1343
  case e.MX:
1330
- o.data = G.read(t, n);
1344
+ o.data = B.read(t, n);
1331
1345
  return o;
1332
1346
 
1333
1347
  case e.TXT:
1334
- o.data = V.read(t, n);
1348
+ o.data = Y.read(t, n);
1335
1349
  return o;
1336
1350
 
1337
1351
  case e.RP:
1338
- o.data = $.read(t, n);
1352
+ o.data = q.read(t, n);
1339
1353
  return o;
1340
1354
 
1341
1355
  case e.AAAA:
1342
- o.data = M.read(t, n);
1356
+ o.data = V.read(t, n);
1343
1357
  return o;
1344
1358
 
1345
1359
  case e.SRV:
1346
- o.data = Y.read(t, n);
1360
+ o.data = K.read(t, n);
1347
1361
  return o;
1348
1362
 
1349
1363
  case e.NAPTR:
1350
- o.data = W.read(t, n);
1364
+ o.data = Z.read(t, n);
1351
1365
  return o;
1352
1366
 
1353
1367
  case e.DS:
1354
- o.data = z.read(t, n);
1368
+ o.data = W.read(t, n);
1355
1369
  return o;
1356
1370
 
1357
1371
  case e.SSHFP:
1358
- o.data = j.read(t, n);
1372
+ o.data = z.read(t, n);
1359
1373
  return o;
1360
1374
 
1361
1375
  case e.RRSIG:
1362
- o.data = k.read(t, n);
1376
+ o.data = $.read(t, n);
1363
1377
  return o;
1364
1378
 
1365
1379
  case e.NSEC:
1366
- o.data = q.read(t, n);
1380
+ o.data = Q.read(t, n);
1367
1381
  return o;
1368
1382
 
1369
1383
  case e.DNSKEY:
1370
- o.data = B.read(t, n);
1384
+ o.data = k.read(t, n);
1371
1385
  return o;
1372
1386
 
1373
1387
  case e.NSEC3:
1374
- o.data = Q.read(t, n);
1388
+ o.data = j.read(t, n);
1375
1389
  return o;
1376
1390
 
1377
1391
  case e.TLSA:
1378
- o.data = Z.read(t, n);
1392
+ o.data = J.read(t, n);
1379
1393
  return o;
1380
1394
 
1381
1395
  case e.SVCB:
1382
1396
  case e.HTTPS:
1383
- o.data = J.read(t, n);
1397
+ o.data = tt.read(t, n);
1384
1398
  return o;
1385
1399
 
1386
1400
  case e.CAA:
1387
- o.data = X.read(t, n);
1401
+ o.data = F.read(t, n);
1388
1402
  return o;
1389
1403
 
1390
1404
  case e.PTR:
1391
1405
  case e.CNAME:
1392
1406
  case e.DNAME:
1393
- o.data = x.read(t, n);
1407
+ o.data = _.read(t, n);
1394
1408
  return o;
1395
1409
 
1396
1410
  default:
1397
- o.data = H.read(t, n);
1411
+ o.data = x.read(t, n);
1398
1412
  return o;
1399
1413
  }
1400
1414
  }
@@ -1412,22 +1426,22 @@ const readList = (t, e, n, r) => {
1412
1426
  return i;
1413
1427
  };
1414
1428
 
1415
- const rt = {
1429
+ const st = {
1416
1430
  bytes(t) {
1417
1431
  const {questions: e, answers: n, authorities: r, additionals: s} = t;
1418
1432
  let a = 12;
1419
1433
  let i = 0;
1420
1434
  for (i = 0; e && i < e.length; i++) {
1421
- a += h.bytes(e[i]);
1435
+ a += w.bytes(e[i]);
1422
1436
  }
1423
1437
  for (i = 0; n && i < n.length; i++) {
1424
- a += nt.bytes(n[i]);
1438
+ a += rt.bytes(n[i]);
1425
1439
  }
1426
1440
  for (i = 0; r && i < r.length; i++) {
1427
- a += nt.bytes(r[i]);
1441
+ a += rt.bytes(r[i]);
1428
1442
  }
1429
1443
  for (i = 0; s && i < s.length; i++) {
1430
- a += nt.bytes(s[i]);
1444
+ a += rt.bytes(s[i]);
1431
1445
  }
1432
1446
  return a;
1433
1447
  },
@@ -1443,16 +1457,16 @@ const rt = {
1443
1457
  n += 12;
1444
1458
  let f = 0;
1445
1459
  for (f = 0; s && f < s.length; f++) {
1446
- n = h.write(e, n, s[f]);
1460
+ n = w.write(e, n, s[f]);
1447
1461
  }
1448
1462
  for (f = 0; a && f < a.length; f++) {
1449
- n = nt.write(e, n, a[f]);
1463
+ n = rt.write(e, n, a[f]);
1450
1464
  }
1451
1465
  for (f = 0; i && f < i.length; f++) {
1452
- n = nt.write(e, n, i[f]);
1466
+ n = rt.write(e, n, i[f]);
1453
1467
  }
1454
1468
  for (f = 0; o && f < o.length; f++) {
1455
- n = nt.write(e, n, o[f]);
1469
+ n = rt.write(e, n, o[f]);
1456
1470
  }
1457
1471
  return n;
1458
1472
  },
@@ -1469,17 +1483,17 @@ const rt = {
1469
1483
  flags: s,
1470
1484
  rtype: 15 & s,
1471
1485
  type: s & t.RESPONSE ? t.RESPONSE : t.QUERY,
1472
- questions: readList(h, e, n, a),
1473
- answers: readList(nt, e, n, i),
1474
- authorities: readList(nt, e, n, o),
1475
- additionals: readList(nt, e, n, c)
1486
+ questions: readList(w, e, n, a),
1487
+ answers: readList(rt, e, n, i),
1488
+ authorities: readList(rt, e, n, o),
1489
+ additionals: readList(rt, e, n, c)
1476
1490
  };
1477
1491
  }
1478
1492
  };
1479
1493
 
1480
1494
  function decode(t) {
1481
1495
  const e = "buffer" in t ? new DataView(t.buffer, t.byteOffset, t.byteLength) : new DataView(t);
1482
- return rt.read(e, {
1496
+ return st.read(e, {
1483
1497
  offset: 0,
1484
1498
  length: e.byteLength
1485
1499
  });
@@ -1487,28 +1501,28 @@ function decode(t) {
1487
1501
 
1488
1502
  function streamDecode(t) {
1489
1503
  const e = "buffer" in t ? new DataView(t.buffer, t.byteOffset, t.byteLength) : new DataView(t);
1490
- const n = Math.min(e.byteLength, e.getUint16(0)) - 2;
1491
- return rt.read(e, {
1504
+ const n = Math.min(e.byteLength - 2, e.getUint16(0));
1505
+ return st.read(e, {
1492
1506
  offset: 2,
1493
1507
  length: n
1494
1508
  });
1495
1509
  }
1496
1510
 
1497
1511
  function encodingLength(t) {
1498
- return rt.bytes(t);
1512
+ return st.bytes(t);
1499
1513
  }
1500
1514
 
1501
1515
  function encode(t) {
1502
- const e = new ArrayBuffer(rt.bytes(t));
1503
- const n = rt.write(new DataView(e), 0, t);
1516
+ const e = new ArrayBuffer(st.bytes(t));
1517
+ const n = st.write(new DataView(e), 0, t);
1504
1518
  return new Uint8Array(e, 0, n);
1505
1519
  }
1506
1520
 
1507
1521
  function streamEncode(t) {
1508
- const e = new ArrayBuffer(rt.bytes(t) + 2);
1522
+ const e = new ArrayBuffer(st.bytes(t) + 2);
1509
1523
  const n = new DataView(e);
1510
- const r = rt.write(n, 2, t);
1511
- n.setUint16(0, r);
1524
+ const r = st.write(n, 2, t);
1525
+ n.setUint16(0, r - 2);
1512
1526
  return new Uint8Array(e, 0, r);
1513
1527
  }
1514
1528