@bigbinary/neeto-molecules 4.1.22 → 4.1.24

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.
@@ -366,93 +366,86 @@ function requireIPv6Utils () {
366
366
 
367
367
  var HexadecimalUtils = {};
368
368
 
369
- var hasRequiredHexadecimalUtils;
370
-
371
- function requireHexadecimalUtils () {
372
- if (hasRequiredHexadecimalUtils) return HexadecimalUtils;
373
- hasRequiredHexadecimalUtils = 1;
374
- (function (exports$1) {
375
- Object.defineProperty(exports$1, "__esModule", { value: true });
376
- exports$1.hexadectetNotationToBinaryString = exports$1.binaryStringToHexadecimalString = exports$1.colonHexadecimalNotationToBinaryString = exports$1.hexadecimalStringToHexadecatetString = exports$1.hexadecimalStringToBinaryString = exports$1.bigIntToHexadecimalString = void 0;
377
- const IPv6Utils_1 = requireIPv6Utils();
378
- const BinaryUtils_1 = BinaryUtils;
379
- /**
380
- * Converts a given bigint number to a hexadecimal string
381
- * @param num the bigint number
382
- * @returns {string} the hexadeciaml string
383
- */
384
- let bigIntToHexadecimalString = (num) => {
385
- return num.toString(16);
386
- };
387
- exports$1.bigIntToHexadecimalString = bigIntToHexadecimalString;
388
- /**
389
- * Converts a number in hexadecimal (base 16) to binary string
390
- * @param {string} hexadecimalString the number in base 16
391
- * @returns {string} the number converted to base 2
392
- */
393
- let hexadecimalStringToBinaryString = (hexadecimalString) => {
394
- let inDecimal = BigInt(`0x${hexadecimalString}`);
395
- return inDecimal.toString(2);
396
- };
397
- exports$1.hexadecimalStringToBinaryString = hexadecimalStringToBinaryString;
398
- /**
399
- * Converts a number in hexadecimal (base 16) to binary hexadecatet string.
400
- * This means the bits in the output cannot be more than 16
401
- *
402
- * @param hexadecimalString {string} the number converted to binary hexadecatet string
403
- */
404
- let hexadecimalStringToHexadecatetString = (hexadecimalString) => {
405
- let binaryString = (0, exports$1.hexadecimalStringToBinaryString)(hexadecimalString);
406
- let length = binaryString.length;
407
- if (length > 16) {
408
- throw new Error("Given decimal in binary contains digits greater than an Hexadecatet");
409
- }
410
- return (0, BinaryUtils_1.leftPadWithZeroBit)(binaryString, 16);
411
- };
412
- exports$1.hexadecimalStringToHexadecatetString = hexadecimalStringToHexadecatetString;
413
- /**
414
- * Given an IPv6 number in hexadecimal notated string, e.g 2001:0db8:0000:0000:0000:0000:0000:0000 converts it to
415
- * binary string
416
- *
417
- * @param hexadecimalString IPv6 string
418
- * @returns {string} the binary value of the given ipv6 number in string
419
- */
420
- let colonHexadecimalNotationToBinaryString = (hexadecimalString) => {
421
- let expandedIPv6 = (0, IPv6Utils_1.expandIPv6Number)(hexadecimalString);
422
- let stringHexadecimal = expandedIPv6.split(":");
423
- return stringHexadecimal.reduce((binaryAsString, hexidecimal) => {
424
- return binaryAsString.concat((0, exports$1.hexadecimalStringToHexadecatetString)(hexidecimal));
425
- }, '');
426
- };
427
- exports$1.colonHexadecimalNotationToBinaryString = colonHexadecimalNotationToBinaryString;
428
- /**
429
- * Converts number in binary string to hexadecimal string
430
- * @param {string} num in binary string
431
- * @returns {string} num in hexadecimal string
432
- */
433
- let binaryStringToHexadecimalString = (num) => {
434
- // first convert to binary string to decimal (big Integer)
435
- let inDecimal = BigInt(`0b${num}`);
436
- return inDecimal.toString(16);
437
- };
438
- exports$1.binaryStringToHexadecimalString = binaryStringToHexadecimalString;
439
- /**
440
- * Converts a given IPv6 number expressed in the hexadecimal string notation into a 16 bit binary number in string
441
- * @param {string} hexadectetString the IPv6 number
442
- * @returns {string} the IPv6 number converted to binary string
443
- */
444
- let hexadectetNotationToBinaryString = (hexadectetString) => {
445
- let expand = (0, IPv6Utils_1.expandIPv6Number)(hexadectetString);
446
- let hexadecimals = expand.split(":");
447
- return hexadecimals.reduce((hexadecimalAsString, hexavalue) => {
448
- return hexadecimalAsString.concat((0, BinaryUtils_1.leftPadWithZeroBit)((0, exports$1.hexadecimalStringToBinaryString)(hexavalue), 16));
449
- }, '');
450
- };
451
- exports$1.hexadectetNotationToBinaryString = hexadectetNotationToBinaryString;
452
-
453
- } (HexadecimalUtils));
454
- return HexadecimalUtils;
455
- }
369
+ (function (exports$1) {
370
+ Object.defineProperty(exports$1, "__esModule", { value: true });
371
+ exports$1.hexadectetNotationToBinaryString = exports$1.binaryStringToHexadecimalString = exports$1.colonHexadecimalNotationToBinaryString = exports$1.hexadecimalStringToHexadecatetString = exports$1.hexadecimalStringToBinaryString = exports$1.bigIntToHexadecimalString = void 0;
372
+ const IPv6Utils_1 = requireIPv6Utils();
373
+ const BinaryUtils_1 = BinaryUtils;
374
+ /**
375
+ * Converts a given bigint number to a hexadecimal string
376
+ * @param num the bigint number
377
+ * @returns {string} the hexadeciaml string
378
+ */
379
+ let bigIntToHexadecimalString = (num) => {
380
+ return num.toString(16);
381
+ };
382
+ exports$1.bigIntToHexadecimalString = bigIntToHexadecimalString;
383
+ /**
384
+ * Converts a number in hexadecimal (base 16) to binary string
385
+ * @param {string} hexadecimalString the number in base 16
386
+ * @returns {string} the number converted to base 2
387
+ */
388
+ let hexadecimalStringToBinaryString = (hexadecimalString) => {
389
+ let inDecimal = BigInt(`0x${hexadecimalString}`);
390
+ return inDecimal.toString(2);
391
+ };
392
+ exports$1.hexadecimalStringToBinaryString = hexadecimalStringToBinaryString;
393
+ /**
394
+ * Converts a number in hexadecimal (base 16) to binary hexadecatet string.
395
+ * This means the bits in the output cannot be more than 16
396
+ *
397
+ * @param hexadecimalString {string} the number converted to binary hexadecatet string
398
+ */
399
+ let hexadecimalStringToHexadecatetString = (hexadecimalString) => {
400
+ let binaryString = (0, exports$1.hexadecimalStringToBinaryString)(hexadecimalString);
401
+ let length = binaryString.length;
402
+ if (length > 16) {
403
+ throw new Error("Given decimal in binary contains digits greater than an Hexadecatet");
404
+ }
405
+ return (0, BinaryUtils_1.leftPadWithZeroBit)(binaryString, 16);
406
+ };
407
+ exports$1.hexadecimalStringToHexadecatetString = hexadecimalStringToHexadecatetString;
408
+ /**
409
+ * Given an IPv6 number in hexadecimal notated string, e.g 2001:0db8:0000:0000:0000:0000:0000:0000 converts it to
410
+ * binary string
411
+ *
412
+ * @param hexadecimalString IPv6 string
413
+ * @returns {string} the binary value of the given ipv6 number in string
414
+ */
415
+ let colonHexadecimalNotationToBinaryString = (hexadecimalString) => {
416
+ let expandedIPv6 = (0, IPv6Utils_1.expandIPv6Number)(hexadecimalString);
417
+ let stringHexadecimal = expandedIPv6.split(":");
418
+ return stringHexadecimal.reduce((binaryAsString, hexidecimal) => {
419
+ return binaryAsString.concat((0, exports$1.hexadecimalStringToHexadecatetString)(hexidecimal));
420
+ }, '');
421
+ };
422
+ exports$1.colonHexadecimalNotationToBinaryString = colonHexadecimalNotationToBinaryString;
423
+ /**
424
+ * Converts number in binary string to hexadecimal string
425
+ * @param {string} num in binary string
426
+ * @returns {string} num in hexadecimal string
427
+ */
428
+ let binaryStringToHexadecimalString = (num) => {
429
+ // first convert to binary string to decimal (big Integer)
430
+ let inDecimal = BigInt(`0b${num}`);
431
+ return inDecimal.toString(16);
432
+ };
433
+ exports$1.binaryStringToHexadecimalString = binaryStringToHexadecimalString;
434
+ /**
435
+ * Converts a given IPv6 number expressed in the hexadecimal string notation into a 16 bit binary number in string
436
+ * @param {string} hexadectetString the IPv6 number
437
+ * @returns {string} the IPv6 number converted to binary string
438
+ */
439
+ let hexadectetNotationToBinaryString = (hexadectetString) => {
440
+ let expand = (0, IPv6Utils_1.expandIPv6Number)(hexadectetString);
441
+ let hexadecimals = expand.split(":");
442
+ return hexadecimals.reduce((hexadecimalAsString, hexavalue) => {
443
+ return hexadecimalAsString.concat((0, BinaryUtils_1.leftPadWithZeroBit)((0, exports$1.hexadecimalStringToBinaryString)(hexavalue), 16));
444
+ }, '');
445
+ };
446
+ exports$1.hexadectetNotationToBinaryString = hexadectetNotationToBinaryString;
447
+
448
+ } (HexadecimalUtils));
456
449
 
457
450
  var hasRequiredValidator;
458
451
 
@@ -464,8 +457,8 @@ function requireValidator () {
464
457
  const BinaryUtils_1 = BinaryUtils;
465
458
  const BinaryUtils_2 = BinaryUtils;
466
459
  const IPv6Utils_1 = requireIPv6Utils();
467
- const HexadecimalUtils_1 = requireHexadecimalUtils();
468
- const HexadecimalUtils_2 = requireHexadecimalUtils();
460
+ const HexadecimalUtils_1 = HexadecimalUtils;
461
+ const HexadecimalUtils_2 = HexadecimalUtils;
469
462
  let Validator$1 = class Validator {
470
463
  /**
471
464
  * Checks if given ipNumber is in between the given lower and upper bound
@@ -962,9 +955,9 @@ const BinaryUtils_2 = BinaryUtils;
962
955
  const BinaryUtils_3 = BinaryUtils;
963
956
  const BinaryUtils_4 = BinaryUtils;
964
957
  const Hexadecatet_1$1 = Hexadecatet$1;
965
- const HexadecimalUtils_1$1 = requireHexadecimalUtils();
958
+ const HexadecimalUtils_1$1 = HexadecimalUtils;
966
959
  const IPv6Utils_1 = requireIPv6Utils();
967
- const HexadecimalUtils_2 = requireHexadecimalUtils();
960
+ const HexadecimalUtils_2 = HexadecimalUtils;
968
961
  /**
969
962
  * Provides the implementation of functionality that are common
970
963
  * to {@link IPv4}, {@link IPv6}, {@link IPv4Mask} and {@link IPv6Mask}
@@ -1715,7 +1708,7 @@ Prefix.isIPv4Prefix = isIPv4Prefix;
1715
1708
  const Validator_1$1 = requireValidator();
1716
1709
  const IPNumber_1$1 = IPNumber;
1717
1710
  const BinaryUtils_1$1 = BinaryUtils;
1718
- const HexadecimalUtils_1 = requireHexadecimalUtils();
1711
+ const HexadecimalUtils_1 = HexadecimalUtils;
1719
1712
  const Hexadecatet_1 = Hexadecatet$1;
1720
1713
  /**
1721
1714
  * Represents the prefix portion in the CIDR notation for representing IP ranges
@@ -3213,7 +3206,7 @@ class SortedSet {
3213
3206
  */
3214
3207
  __exportStar(BinaryUtils, exports$1);
3215
3208
  __exportStar(Hexadecatet$1, exports$1);
3216
- __exportStar(requireHexadecimalUtils(), exports$1);
3209
+ __exportStar(HexadecimalUtils, exports$1);
3217
3210
  __exportStar(IPNumber, exports$1);
3218
3211
  __exportStar(IPNumType, exports$1);
3219
3212
  __exportStar(IPPool, exports$1);