mirror of
https://github.com/sharevb/it-tools.git
synced 2026-11-20 21:23:08 +03:00
1 parent
1f3dfc502d
commit
eead4e135f
13 files changed
+1068
-993
No files matched your search
Vendored
+1
-1
@@ -176,10 +176,10 @@ declare module '@vue/runtime-core' {
|
|||||||
ImageToCss: typeof import('./src/tools/image-to-css/image-to-css.vue')['default']
|
ImageToCss: typeof import('./src/tools/image-to-css/image-to-css.vue')['default']
|
||||||
InputCopyable: typeof import('./src/components/InputCopyable.vue')['default']
|
InputCopyable: typeof import('./src/components/InputCopyable.vue')['default']
|
||||||
IntegerBaseConverter: typeof import('./src/tools/integer-base-converter/integer-base-converter.vue')['default']
|
IntegerBaseConverter: typeof import('./src/tools/integer-base-converter/integer-base-converter.vue')['default']
|
||||||
IpInRange: typeof import('./src/tools/cidr-in-cidr/cidr-in-cidr.vue')['default']
|
|
||||||
IntegersToIp: typeof import('./src/tools/integers-to-ip/integers-to-ip.vue')['default']
|
IntegersToIp: typeof import('./src/tools/integers-to-ip/integers-to-ip.vue')['default']
|
||||||
IpCidrToRange: typeof import('./src/tools/ip-cidr-to-range/ip-cidr-to-range.vue')['default']
|
IpCidrToRange: typeof import('./src/tools/ip-cidr-to-range/ip-cidr-to-range.vue')['default']
|
||||||
IpGeoLocation: typeof import('./src/tools/ip-geo-location/ip-geo-location.vue')['default']
|
IpGeoLocation: typeof import('./src/tools/ip-geo-location/ip-geo-location.vue')['default']
|
||||||
|
IpIncludeExclude: typeof import('./src/tools/ip-include-exclude/ip-include-exclude.vue')['default']
|
||||||
IpInRange: typeof import('./src/tools/ip-in-range/ip-in-range.vue')['default']
|
IpInRange: typeof import('./src/tools/ip-in-range/ip-in-range.vue')['default']
|
||||||
IpRangeToCidr: typeof import('./src/tools/ip-range-to-cidr/ip-range-to-cidr.vue')['default']
|
IpRangeToCidr: typeof import('./src/tools/ip-range-to-cidr/ip-range-to-cidr.vue')['default']
|
||||||
Ipv4AddressConverter: typeof import('./src/tools/ipv4-address-converter/ipv4-address-converter.vue')['default']
|
Ipv4AddressConverter: typeof import('./src/tools/ipv4-address-converter/ipv4-address-converter.vue')['default']
|
||||||
|
|||||||
+2
-2
@@ -79,7 +79,7 @@
|
|||||||
"change-case": "^4.1.2",
|
"change-case": "^4.1.2",
|
||||||
"chatgpt-prompt-splitter": "^1.0.5",
|
"chatgpt-prompt-splitter": "^1.0.5",
|
||||||
"chinesegen": "^0.3.3",
|
"chinesegen": "^0.3.3",
|
||||||
"cidr-tools": "^7.0.7",
|
"cidr-tools": "^11.0.2",
|
||||||
"colord": "^2.9.3",
|
"colord": "^2.9.3",
|
||||||
"composerize": "^1.6.12",
|
"composerize": "^1.6.12",
|
||||||
"composeverter": "^1.7.4",
|
"composeverter": "^1.7.4",
|
||||||
@@ -202,7 +202,6 @@
|
|||||||
"pythonstack.js": "^1.0.2",
|
"pythonstack.js": "^1.0.2",
|
||||||
"qpdf-wasm-esm-embedded": "^1.1.1",
|
"qpdf-wasm-esm-embedded": "^1.1.1",
|
||||||
"qrcode": "^1.5.1",
|
"qrcode": "^1.5.1",
|
||||||
"sandybox": "^1.1.2",
|
|
||||||
"qrcode-parser": "^2.1.3",
|
"qrcode-parser": "^2.1.3",
|
||||||
"qrcode-terminal-nooctal": "^0.12.1",
|
"qrcode-terminal-nooctal": "^0.12.1",
|
||||||
"randexp": "^0.5.3",
|
"randexp": "^0.5.3",
|
||||||
@@ -210,6 +209,7 @@
|
|||||||
"roboto-base64": "^0.1.2",
|
"roboto-base64": "^0.1.2",
|
||||||
"rtf-stream-parser": "^3.8.0",
|
"rtf-stream-parser": "^3.8.0",
|
||||||
"safe-license-list": "^0.1.2",
|
"safe-license-list": "^0.1.2",
|
||||||
|
"sandybox": "^1.1.2",
|
||||||
"sanitize-html": "^2.13.1",
|
"sanitize-html": "^2.13.1",
|
||||||
"shiki": "1.22.2",
|
"shiki": "1.22.2",
|
||||||
"silly-password-generator": "^1.0.28",
|
"silly-password-generator": "^1.0.28",
|
||||||
|
|||||||
Generated
+850
-938
File diff suppressed because it is too large.
Load diff
@@ -150,6 +150,7 @@ import { tool as javascriptPrettifier } from './javascript-prettifier';
|
|||||||
import { tool as cssPrettifier } from './css-prettifier';
|
import { tool as cssPrettifier } from './css-prettifier';
|
||||||
import { tool as htmlPrettifier } from './html-prettifier';
|
import { tool as htmlPrettifier } from './html-prettifier';
|
||||||
import { tool as x509CertificateGenerator } from './x509-certificate-generator';
|
import { tool as x509CertificateGenerator } from './x509-certificate-generator';
|
||||||
|
import { tool as ipIncludeExclude } from './ip-include-exclude';
|
||||||
import { tool as pdfSignatureChecker } from './pdf-signature-checker';
|
import { tool as pdfSignatureChecker } from './pdf-signature-checker';
|
||||||
import { tool as uuidConverter } from './uuid-converter';
|
import { tool as uuidConverter } from './uuid-converter';
|
||||||
import { tool as numeronymGenerator } from './numeronym-generator';
|
import { tool as numeronymGenerator } from './numeronym-generator';
|
||||||
@@ -467,6 +468,7 @@ export const toolsByCategory: ToolCategory[] = [
|
|||||||
ipv6SubnetCalculator,
|
ipv6SubnetCalculator,
|
||||||
ipv4AddressConverter,
|
ipv4AddressConverter,
|
||||||
cidrInCidr,
|
cidrInCidr,
|
||||||
|
ipIncludeExclude,
|
||||||
ipv4RangeExpander,
|
ipv4RangeExpander,
|
||||||
macAddressLookup,
|
macAddressLookup,
|
||||||
macAddressGenerator,
|
macAddressGenerator,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import isCidr from 'is-cidr';
|
import isCidr from 'is-cidr';
|
||||||
import { expand } from 'cidr-tools';
|
import { expandCidr } from 'cidr-tools';
|
||||||
import { getIPNetworkType, parseAsCIDR } from '@/utils/ip';
|
import { getIPNetworkType, parseAsCIDR } from '@/utils/ip';
|
||||||
import { useValidation } from '@/composable/validation';
|
import { useValidation } from '@/composable/validation';
|
||||||
|
|
||||||
@@ -8,7 +8,7 @@ const rawCIDR = useStorage('ip-cidr-to-range:cidr', '192.168.1.0/24'); // NOSONA
|
|||||||
|
|
||||||
const result = computed(() => {
|
const result = computed(() => {
|
||||||
const parsedCIDR = parseAsCIDR(rawCIDR.value) || rawCIDR.value;
|
const parsedCIDR = parseAsCIDR(rawCIDR.value) || rawCIDR.value;
|
||||||
const ips = expand(parsedCIDR);
|
const ips = [...expandCidr(parsedCIDR)];
|
||||||
if (!ips || !ips.length) {
|
if (!ips || !ips.length) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
import { UnfoldMoreOutlined } from '@vicons/material';
|
||||||
|
import { defineTool } from '../tool';
|
||||||
|
|
||||||
|
export const tool = defineTool({
|
||||||
|
name: 'IP Subnets Exclude Calculator',
|
||||||
|
path: '/ip-include-exclude',
|
||||||
|
description: 'Substract a disallowed IP Ranges/Mask/CIDR list from an allowed IP Ranges/Mask/CIDR list',
|
||||||
|
keywords: ['ip', 'allowed', 'disallowed', 'include', 'exclude', 'subnet', 'cidr'],
|
||||||
|
component: () => import('./ip-include-exclude.vue'),
|
||||||
|
icon: UnfoldMoreOutlined,
|
||||||
|
createdAt: new Date('2024-08-15'),
|
||||||
|
});
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
import { describe, expect, it } from 'vitest';
|
||||||
|
import { substractCIDRs } from './ip-include-exclude.service';
|
||||||
|
|
||||||
|
describe('ip-include-exclude', () => {
|
||||||
|
describe('substractCIDRs', () => {
|
||||||
|
it('should return error on invalid values', () => {
|
||||||
|
expect(substractCIDRs({ allowedRanges: '192.168.0.', disallowedRanges: '' })).to.deep.eq({ // NOSONAR
|
||||||
|
allowedCIDRs: [],
|
||||||
|
allowedSubnets: [],
|
||||||
|
disallowedSubnets: [],
|
||||||
|
error: 'Error: Invalid IP (range/subnetwork)',
|
||||||
|
});
|
||||||
|
});
|
||||||
|
it('should return correct substractions and subnets', () => {
|
||||||
|
expect(substractCIDRs({ allowedRanges: '192.168.3.0/24', disallowedRanges: '' })).to.deep.eq({ // NOSONAR
|
||||||
|
allowedCIDRs: ['192.168.3.0/24'], // NOSONAR
|
||||||
|
allowedSubnets: [{ cidr: '192.168.3.0/24', end: '192.168.3.255', start: '192.168.3.0' }], // NOSONAR
|
||||||
|
disallowedSubnets: [],
|
||||||
|
error: '',
|
||||||
|
});
|
||||||
|
expect(substractCIDRs({ allowedRanges: '192.168.2.0/24', disallowedRanges: '192.168.2.1' })).to.deep.eq({ // NOSONAR
|
||||||
|
allowedCIDRs: ['192.168.2.0/32', // NOSONAR
|
||||||
|
'192.168.2.2/31', // NOSONAR
|
||||||
|
'192.168.2.4/30', // NOSONAR
|
||||||
|
'192.168.2.8/29', // NOSONAR
|
||||||
|
'192.168.2.16/28', // NOSONAR
|
||||||
|
'192.168.2.32/27', // NOSONAR
|
||||||
|
'192.168.2.64/26', // NOSONAR
|
||||||
|
'192.168.2.128/25'], // NOSONAR
|
||||||
|
allowedSubnets: [
|
||||||
|
{ cidr: '192.168.2.0/24', end: '192.168.2.255', start: '192.168.2.0' }, // NOSONAR
|
||||||
|
],
|
||||||
|
disallowedSubnets: [
|
||||||
|
{ cidr: '192.168.2.1/32', end: '192.168.2.1', start: '192.168.2.1' }, // NOSONAR
|
||||||
|
],
|
||||||
|
error: '',
|
||||||
|
});
|
||||||
|
expect(substractCIDRs({ allowedRanges: '192.168.12.0/24', disallowedRanges: '192.168.12.1-192.168.12.10, 192.168.12.34' })).to.deep.eq({ // NOSONAR
|
||||||
|
allowedCIDRs: ['192.168.12.0/32', // NOSONAR
|
||||||
|
'192.168.12.11/32', // NOSONAR
|
||||||
|
'192.168.12.12/30', // NOSONAR
|
||||||
|
'192.168.12.16/28', // NOSONAR
|
||||||
|
'192.168.12.32/31', // NOSONAR
|
||||||
|
'192.168.12.35/32', // NOSONAR
|
||||||
|
'192.168.12.36/30', // NOSONAR
|
||||||
|
'192.168.12.40/29', // NOSONAR
|
||||||
|
'192.168.12.48/28', // NOSONAR
|
||||||
|
'192.168.12.64/26', // NOSONAR
|
||||||
|
'192.168.12.128/25'], // NOSONAR
|
||||||
|
allowedSubnets: [{ cidr: '192.168.12.0/24', end: '192.168.12.255', start: '192.168.12.0' }], // NOSONAR
|
||||||
|
disallowedSubnets: [
|
||||||
|
{ cidr: '192.168.12.1/32', end: '192.168.12.1', start: '192.168.12.1' }, // NOSONAR
|
||||||
|
{ cidr: '192.168.12.2/31', end: '192.168.12.3', start: '192.168.12.2' }, // NOSONAR
|
||||||
|
{ cidr: '192.168.12.4/30', end: '192.168.12.7', start: '192.168.12.4' }, // NOSONAR
|
||||||
|
{ cidr: '192.168.12.8/31', end: '192.168.12.9', start: '192.168.12.8' }, // NOSONAR
|
||||||
|
{ cidr: '192.168.12.10/32', end: '192.168.12.10', start: '192.168.12.10' }, // NOSONAR
|
||||||
|
{ cidr: '192.168.12.34/32', end: '192.168.12.34', start: '192.168.12.34' }, // NOSONAR
|
||||||
|
],
|
||||||
|
error: '',
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
import type { IPMask } from 'ip-matching';
|
||||||
|
import { getMatch } from 'ip-matching';
|
||||||
|
import { excludeCidr } from 'cidr-tools';
|
||||||
|
|
||||||
|
function convertToCIDR(mask: IPMask) {
|
||||||
|
const subnet = mask.convertToSubnet();
|
||||||
|
if (!subnet) {
|
||||||
|
return { cidr: mask.toString(), start: '', end: '' };
|
||||||
|
}
|
||||||
|
return {
|
||||||
|
cidr: subnet.toString(),
|
||||||
|
start: subnet.getFirst().toString(),
|
||||||
|
end: subnet.getLast().toString(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
export function substractCIDRs(
|
||||||
|
{ allowedRanges, disallowedRanges }:
|
||||||
|
{
|
||||||
|
allowedRanges: string
|
||||||
|
disallowedRanges: string
|
||||||
|
}) {
|
||||||
|
try {
|
||||||
|
const allowedRangesMatchMasks = allowedRanges.split(/\s*[,;|]+\s*/g) // NOSONAR
|
||||||
|
.filter(range => range)
|
||||||
|
.flatMap(range => getMatch(range)?.convertToMasks() || []);
|
||||||
|
const disallowedRangesMatchMasks = disallowedRanges.split(/\s*[,;|]+\s*/g) // NOSONAR
|
||||||
|
.filter(range => range)
|
||||||
|
.flatMap(range => getMatch(range)?.convertToMasks() || []);
|
||||||
|
|
||||||
|
const allowedSubnets = allowedRangesMatchMasks.map(convertToCIDR);
|
||||||
|
const disallowedSubnets = disallowedRangesMatchMasks.map(convertToCIDR);
|
||||||
|
|
||||||
|
return {
|
||||||
|
error: '',
|
||||||
|
allowedSubnets,
|
||||||
|
disallowedSubnets,
|
||||||
|
allowedCIDRs: excludeCidr(allowedSubnets.map(net => net.cidr), disallowedSubnets.map(net => net.cidr)),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
catch (e: any) {
|
||||||
|
return {
|
||||||
|
error: e.toString(),
|
||||||
|
allowedSubnets: [],
|
||||||
|
disallowedSubnets: [],
|
||||||
|
allowedCIDRs: [],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
<script setup lang="ts">
|
||||||
|
import { useStorage } from '@vueuse/core';
|
||||||
|
import { substractCIDRs } from './ip-include-exclude.service';
|
||||||
|
import SpanCopyable from '@/components/SpanCopyable.vue';
|
||||||
|
import TextareaCopyable from '@/components/TextareaCopyable.vue';
|
||||||
|
|
||||||
|
const allowedRanges = useStorage('ip-inc-exc:allow', '192.168.0.1/24'); // NOSONAR
|
||||||
|
const disallowedRanges = useStorage('ip-inc-exc:disallow', '192.168.0.6'); // NOSONAR
|
||||||
|
|
||||||
|
const result = computed(() => substractCIDRs({
|
||||||
|
allowedRanges: allowedRanges.value, disallowedRanges: disallowedRanges.value,
|
||||||
|
}));
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<c-input-text
|
||||||
|
v-model:value="allowedRanges"
|
||||||
|
label="AllowedIPs (IPv4/6 CIDR/Range/Mask/Wildcard)"
|
||||||
|
placeholder="An IPv4/6 CIDR/Range/Mask/Wildcard..."
|
||||||
|
mb-4
|
||||||
|
/>
|
||||||
|
|
||||||
|
<c-input-text
|
||||||
|
v-model:value="disallowedRanges"
|
||||||
|
label="DisallowedIPs (IPv4/6 CIDR/Range/Mask/Wildcard)"
|
||||||
|
placeholder="An IPv4/6 CIDR/Range/Mask/Wildcard..."
|
||||||
|
mb-4
|
||||||
|
/>
|
||||||
|
|
||||||
|
<n-divider />
|
||||||
|
|
||||||
|
<c-alert v-if="result.error">
|
||||||
|
{{ result.error }}
|
||||||
|
</c-alert>
|
||||||
|
|
||||||
|
<div v-if="!result.error">
|
||||||
|
<n-form-item label="Final AllowedIPs:">
|
||||||
|
<TextareaCopyable :value="result.allowedCIDRs.join(', ')" />
|
||||||
|
</n-form-item>
|
||||||
|
|
||||||
|
<n-divider />
|
||||||
|
|
||||||
|
<c-card title="Allowed Subnets">
|
||||||
|
<n-table>
|
||||||
|
<tbody>
|
||||||
|
<tr v-for="{ cidr, start, end } in result.allowedSubnets" :key="cidr">
|
||||||
|
<td font-bold>
|
||||||
|
<SpanCopyable :value="cidr" />
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<SpanCopyable :value="start" />
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<SpanCopyable :value="end" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</n-table>
|
||||||
|
</c-card>
|
||||||
|
<c-card title="Disallowed Subnets">
|
||||||
|
<n-table>
|
||||||
|
<tbody>
|
||||||
|
<tr v-for="{ cidr, start, end } in result.disallowedSubnets" :key="cidr">
|
||||||
|
<td font-bold>
|
||||||
|
<SpanCopyable :value="cidr" />
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<SpanCopyable :value="start" />
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<SpanCopyable :value="end" />
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</n-table>
|
||||||
|
</c-card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { merge, parse } from 'cidr-tools';
|
import { mergeCidr, parseCidr } from 'cidr-tools';
|
||||||
import { isIP, isIPv6 } from 'is-ip';
|
import { isIP, isIPv6 } from 'is-ip';
|
||||||
import { Exchange } from '@vicons/tabler';
|
import { Exchange } from '@vicons/tabler';
|
||||||
import { stringifyIp } from 'ip-bigint';
|
import { stringifyIp } from 'ip-bigint';
|
||||||
@@ -19,8 +19,8 @@ const result = computed(() => {
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
const startIp = parse(rawStartAddress.value).start;
|
const startIp = parseCidr(rawStartAddress.value).start;
|
||||||
const endIp = parse(rawEndAddress.value).end;
|
const endIp = parseCidr(rawEndAddress.value).end;
|
||||||
isReversed.value = startIp > endIp;
|
isReversed.value = startIp > endIp;
|
||||||
if (isReversed.value) {
|
if (isReversed.value) {
|
||||||
return [];
|
return [];
|
||||||
@@ -34,7 +34,7 @@ const result = computed(() => {
|
|||||||
allIps[i] = iterIp++;
|
allIps[i] = iterIp++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return merge(Array.from(allIps, ip => stringifyIp({ number: ip, version })));
|
return mergeCidr(Array.from(allIps, ip => stringifyIp({ number: ip, version })));
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
return [];
|
return [];
|
||||||
|
|||||||
@@ -1,43 +0,0 @@
|
|||||||
declare module 'cidr-tools' {
|
|
||||||
type IPv4Address = string;
|
|
||||||
type IPv4CIDR = string;
|
|
||||||
type IPv6Address = string;
|
|
||||||
type IPv6CIDR = string;
|
|
||||||
|
|
||||||
type Network = IPv4Address | IPv4CIDR | IPv6Address | IPv6CIDR;
|
|
||||||
type Networks = Network | Network[];
|
|
||||||
|
|
||||||
type Parsed = {
|
|
||||||
cidr: string;
|
|
||||||
version: number;
|
|
||||||
prefix: string;
|
|
||||||
start: bigint;
|
|
||||||
end: bigint;
|
|
||||||
single: boolean;
|
|
||||||
ip: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
type NormalizeOpts = {
|
|
||||||
compress?: boolean;
|
|
||||||
hexify?: boolean;
|
|
||||||
};
|
|
||||||
|
|
||||||
export function merge(networks: Networks): Network[];
|
|
||||||
export function exclude(baseNetworks: Networks, excludeNetworks: Networks): Network[];
|
|
||||||
export function expand(networks: Networks): Network[];
|
|
||||||
export function overlap(networksA: Networks, networksB: Networks): boolean;
|
|
||||||
export function normalize(cidr: Networks, opts?: NormalizeOpts): Networks;
|
|
||||||
export function contains(networksA: Networks, networksB: Networks): boolean;
|
|
||||||
export function parse(network: Network): Parsed;
|
|
||||||
|
|
||||||
declare const _default: {
|
|
||||||
merge: typeof merge;
|
|
||||||
exclude: typeof exclude;
|
|
||||||
expand: typeof expand;
|
|
||||||
overlap: typeof overlap;
|
|
||||||
normalize: typeof normalize;
|
|
||||||
contains: typeof contains;
|
|
||||||
parse: typeof parse;
|
|
||||||
};
|
|
||||||
export default _default;
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { isIPv6 } from 'is-ip';
|
import { isIPv6 } from 'is-ip';
|
||||||
import { parse } from 'cidr-tools';
|
import { parseCidr } from 'cidr-tools';
|
||||||
import { stringifyIp } from 'ip-bigint';
|
import { stringifyIp } from 'ip-bigint';
|
||||||
import { convertBase } from '../integer-base-converter/integer-base-converter.model';
|
import { convertBase } from '../integer-base-converter/integer-base-converter.model';
|
||||||
import { getIPNetworkType, toARPA, toMicrosoftTranscription } from '@/utils/ip';
|
import { getIPNetworkType, toARPA, toMicrosoftTranscription } from '@/utils/ip';
|
||||||
@@ -10,7 +10,7 @@ const rawIpAddress = useStorage('ipv6-converter:ip', '2001:db8:0:85a3::ac1f:8001
|
|||||||
|
|
||||||
const convertedSections = computed(() => {
|
const convertedSections = computed(() => {
|
||||||
try {
|
try {
|
||||||
const parsedIPv6 = parse(rawIpAddress.value);
|
const parsedIPv6 = parseCidr(rawIpAddress.value);
|
||||||
const ipInDecimal = parsedIPv6.start;
|
const ipInDecimal = parsedIPv6.start;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
import { isIPv4 } from 'is-ip';
|
import { isIPv4 } from 'is-ip';
|
||||||
import { Address4, Address6 } from 'ip-address';
|
import { Address4, Address6 } from 'ip-address';
|
||||||
import { contains as containsCidr } from 'cidr-tools';
|
import { containsCidr } from 'cidr-tools';
|
||||||
import type { IPMatch } from 'ip-matching';
|
import type { IPMatch } from 'ip-matching';
|
||||||
import { IPMask, IPSubnetwork, getMatch } from 'ip-matching';
|
import { IPMask, IPSubnetwork, getMatch } from 'ip-matching';
|
||||||
import isCidr from 'is-cidr';
|
import isCidr from 'is-cidr';
|
||||||
|
|||||||
Reference in new issue
Block a user