@bigbinary/neeto-molecules 4.1.24 → 4.1.25
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/IpRestriction.js +93 -86
- package/dist/IpRestriction.js.map +1 -1
- package/dist/cjs/IpRestriction.js +93 -86
- package/dist/cjs/IpRestriction.js.map +1 -1
- package/package.json +1 -1
- package/src/translations/ar.json +3 -1
- package/src/translations/bg.json +3 -1
- package/src/translations/ca.json +3 -1
- package/src/translations/cs.json +3 -1
- package/src/translations/da.json +3 -1
- package/src/translations/de.json +4 -2
- package/src/translations/es-MX.json +3 -1
- package/src/translations/es.json +3 -1
- package/src/translations/et.json +4 -2
- package/src/translations/fi.json +4 -2
- package/src/translations/fil.json +4 -2
- package/src/translations/fr.json +3 -1
- package/src/translations/he.json +3 -1
- package/src/translations/hi.json +3 -1
- package/src/translations/hr.json +3 -1
- package/src/translations/hu.json +4 -2
- package/src/translations/id.json +4 -2
- package/src/translations/it.json +3 -1
- package/src/translations/ja.json +3 -1
- package/src/translations/ko.json +3 -1
- package/src/translations/nl.json +3 -1
- package/src/translations/pl.json +4 -2
- package/src/translations/pt-BR.json +4 -2
- package/src/translations/pt.json +4 -2
- package/src/translations/ro.json +3 -1
- package/src/translations/ru.json +3 -1
- package/src/translations/sk.json +3 -1
- package/src/translations/sl.json +4 -2
- package/src/translations/sv.json +3 -1
- package/src/translations/th.json +3 -1
- package/src/translations/tr.json +4 -2
- package/src/translations/uk.json +3 -1
- package/src/translations/vi.json +3 -1
- package/src/translations/zh-CN.json +3 -1
- package/src/translations/zh-TW.json +3 -1
|
@@ -366,86 +366,93 @@ function requireIPv6Utils () {
|
|
|
366
366
|
|
|
367
367
|
var HexadecimalUtils = {};
|
|
368
368
|
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
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
|
+
}
|
|
449
456
|
|
|
450
457
|
var hasRequiredValidator;
|
|
451
458
|
|
|
@@ -457,8 +464,8 @@ function requireValidator () {
|
|
|
457
464
|
const BinaryUtils_1 = BinaryUtils;
|
|
458
465
|
const BinaryUtils_2 = BinaryUtils;
|
|
459
466
|
const IPv6Utils_1 = requireIPv6Utils();
|
|
460
|
-
const HexadecimalUtils_1 =
|
|
461
|
-
const HexadecimalUtils_2 =
|
|
467
|
+
const HexadecimalUtils_1 = requireHexadecimalUtils();
|
|
468
|
+
const HexadecimalUtils_2 = requireHexadecimalUtils();
|
|
462
469
|
let Validator$1 = class Validator {
|
|
463
470
|
/**
|
|
464
471
|
* Checks if given ipNumber is in between the given lower and upper bound
|
|
@@ -955,9 +962,9 @@ const BinaryUtils_2 = BinaryUtils;
|
|
|
955
962
|
const BinaryUtils_3 = BinaryUtils;
|
|
956
963
|
const BinaryUtils_4 = BinaryUtils;
|
|
957
964
|
const Hexadecatet_1$1 = Hexadecatet$1;
|
|
958
|
-
const HexadecimalUtils_1$1 =
|
|
965
|
+
const HexadecimalUtils_1$1 = requireHexadecimalUtils();
|
|
959
966
|
const IPv6Utils_1 = requireIPv6Utils();
|
|
960
|
-
const HexadecimalUtils_2 =
|
|
967
|
+
const HexadecimalUtils_2 = requireHexadecimalUtils();
|
|
961
968
|
/**
|
|
962
969
|
* Provides the implementation of functionality that are common
|
|
963
970
|
* to {@link IPv4}, {@link IPv6}, {@link IPv4Mask} and {@link IPv6Mask}
|
|
@@ -1708,7 +1715,7 @@ Prefix.isIPv4Prefix = isIPv4Prefix;
|
|
|
1708
1715
|
const Validator_1$1 = requireValidator();
|
|
1709
1716
|
const IPNumber_1$1 = IPNumber;
|
|
1710
1717
|
const BinaryUtils_1$1 = BinaryUtils;
|
|
1711
|
-
const HexadecimalUtils_1 =
|
|
1718
|
+
const HexadecimalUtils_1 = requireHexadecimalUtils();
|
|
1712
1719
|
const Hexadecatet_1 = Hexadecatet$1;
|
|
1713
1720
|
/**
|
|
1714
1721
|
* Represents the prefix portion in the CIDR notation for representing IP ranges
|
|
@@ -3206,7 +3213,7 @@ class SortedSet {
|
|
|
3206
3213
|
*/
|
|
3207
3214
|
__exportStar(BinaryUtils, exports$1);
|
|
3208
3215
|
__exportStar(Hexadecatet$1, exports$1);
|
|
3209
|
-
__exportStar(
|
|
3216
|
+
__exportStar(requireHexadecimalUtils(), exports$1);
|
|
3210
3217
|
__exportStar(IPNumber, exports$1);
|
|
3211
3218
|
__exportStar(IPNumType, exports$1);
|
|
3212
3219
|
__exportStar(IPPool, exports$1);
|