@terascope/utils / ip
ip
Functions
extractMappedIPv4()
extractMappedIPv4(
input
):string
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
string
Source
getCIDRBroadcast()
getCIDRBroadcast(
input
):string
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
string
Source
getCIDRMax()
getCIDRMax(
input
):string
Parameters
Parameter | Type | Description |
---|---|---|
input | unknown | ip address block in CIDR notation |
Returns
string
last ip address in the block
Deprecated
use getLastUsableIPInCIDR
Source
getCIDRMin()
getCIDRMin(
input
):string
Parameters
Parameter | Type | Description |
---|---|---|
input | unknown | ip address block in CIDR notation |
Returns
string
first IP address in the block
Deprecated
use getFirstUsableIPInCIDR
Source
getCIDRNetwork()
getCIDRNetwork(
input
):string
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
string
Source
getFirstIPInCIDR()
getFirstIPInCIDR(
input
):string
Parameters
Parameter | Type | Description |
---|---|---|
input | unknown | ip address block in CIDR notation, inclusive |
Returns
string
first IP address in the block
Source
getFirstUsableIPInCIDR()
getFirstUsableIPInCIDR(
input
):string
Parameters
Parameter | Type | Description |
---|---|---|
input | unknown | ip address block in CIDR notation |
Returns
string
first usable ip address of the CIDR block
Source
getLastIPInCIDR()
getLastIPInCIDR(
input
):string
Parameters
Parameter | Type | Description |
---|---|---|
input | unknown | ip address block in CIDR notation |
Returns
string
last ip address in the block, inclusive
Source
getLastUsableIPInCIDR()
getLastUsableIPInCIDR(
input
):string
Parameters
Parameter | Type | Description |
---|---|---|
input | unknown | ip address block in CIDR notation |
Returns
string
last usable ip address of the CIDR block
Source
inIPRange()
inIPRange(
input
,args
):boolean
Parameters
Parameter | Type |
---|---|
input | unknown |
args | object |
args.cidr ? | string |
args.max ? | string |
args.min ? | string |
Returns
boolean
Source
intToIP()
intToIP(
input
,ipVersion
):string
Parameters
Parameter | Type |
---|---|
input | unknown |
ipVersion | string | number |
Returns
string
Source
ipToInt()
ipToInt(
input
):bigint
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
bigint
Source
isCIDR()
isCIDR(
input
):input is string
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
input is string
Source
isIP()
isIP(
input
):input is string
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
input is string
Source
isIPOrThrow()
isIPOrThrow(
input
):string
Will throw if input is not a valid IP
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
string
Source
isIPRangeOrThrow()
isIPRangeOrThrow(
input
):string
Will throw if input is not a valid CIDR
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
string
Source
isIPv4()
isIPv4(
input
):boolean
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
boolean
Source
isIPv6()
isIPv6(
input
):boolean
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
boolean
Source
isMappedIPv4()
isMappedIPv4(
input
):boolean
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
boolean
Source
isNonRoutableIP()
isNonRoutableIP(
input
):boolean
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
boolean
Source
isNonZeroCidr()
isNonZeroCidr(
input
):boolean
Parameters
Parameter | Type |
---|---|
input | string |
Returns
boolean
Source
isRoutableIP()
isRoutableIP(
input
):boolean
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
boolean
Source
reverseIP()
reverseIP(
input
):string
Parameters
Parameter | Type |
---|---|
input | unknown |
Returns
string
Source
shortenIPv6Address()
shortenIPv6Address(
input
):string
Parameters
Parameter | Type | Description |
---|---|---|
input | unknown | ip address |
Returns
string
IPv6 addresses are returned without leading 0's in a group or empty groups ipv4 addresses are simply returned
Source
toCIDR()
toCIDR(
input
,suffix
):string
Parameters
Parameter | Type |
---|---|
input | unknown |
suffix | string | number |
Returns
string