Skip to main content

@terascope/utils / ip

ip

Functions

extractMappedIPv4()

extractMappedIPv4(input): string

Parameters

ParameterType
inputunknown

Returns

string

Source

packages/utils/src/ip.ts:58


getCIDRBroadcast()

getCIDRBroadcast(input): string

Parameters

ParameterType
inputunknown

Returns

string

Source

packages/utils/src/ip.ts:268


getCIDRMax()

getCIDRMax(input): string

Parameters

ParameterTypeDescription
inputunknownip address block in CIDR notation

Returns

string

last ip address in the block

Deprecated

use getLastUsableIPInCIDR

Source

packages/utils/src/ip.ts:196


getCIDRMin()

getCIDRMin(input): string

Parameters

ParameterTypeDescription
inputunknownip address block in CIDR notation

Returns

string

first IP address in the block

Deprecated

use getFirstUsableIPInCIDR

Source

packages/utils/src/ip.ts:186


getCIDRNetwork()

getCIDRNetwork(input): string

Parameters

ParameterType
inputunknown

Returns

string

Source

packages/utils/src/ip.ts:280


getFirstIPInCIDR()

getFirstIPInCIDR(input): string

Parameters

ParameterTypeDescription
inputunknownip address block in CIDR notation, inclusive

Returns

string

first IP address in the block

Source

packages/utils/src/ip.ts:205


getFirstUsableIPInCIDR()

getFirstUsableIPInCIDR(input): string

Parameters

ParameterTypeDescription
inputunknownip address block in CIDR notation

Returns

string

first usable ip address of the CIDR block

Source

packages/utils/src/ip.ts:231


getLastIPInCIDR()

getLastIPInCIDR(input): string

Parameters

ParameterTypeDescription
inputunknownip address block in CIDR notation

Returns

string

last ip address in the block, inclusive

Source

packages/utils/src/ip.ts:218


getLastUsableIPInCIDR()

getLastUsableIPInCIDR(input): string

Parameters

ParameterTypeDescription
inputunknownip address block in CIDR notation

Returns

string

last usable ip address of the CIDR block

Source

packages/utils/src/ip.ts:245


inIPRange()

inIPRange(input, args): boolean

Parameters

ParameterType
inputunknown
argsobject
args.cidr?string
args.max?string
args.min?string

Returns

boolean

Source

packages/utils/src/ip.ts:70


intToIP()

intToIP(input, ipVersion): string

Parameters

ParameterType
inputunknown
ipVersionstring | number

Returns

string

Source

packages/utils/src/ip.ts:337


ipToInt()

ipToInt(input): bigint

Parameters

ParameterType
inputunknown

Returns

bigint

Source

packages/utils/src/ip.ts:329


isCIDR()

isCIDR(input): input is string

Parameters

ParameterType
inputunknown

Returns

input is string

Source

packages/utils/src/ip.ts:176


isIP()

isIP(input): input is string

Parameters

ParameterType
inputunknown

Returns

input is string

Source

packages/utils/src/ip.ts:18


isIPOrThrow()

isIPOrThrow(input): string

Will throw if input is not a valid IP

Parameters

ParameterType
inputunknown

Returns

string

Source

packages/utils/src/ip.ts:32


isIPRangeOrThrow()

isIPRangeOrThrow(input): string

Will throw if input is not a valid CIDR

Parameters

ParameterType
inputunknown

Returns

string

Source

packages/utils/src/ip.ts:23


isIPv4()

isIPv4(input): boolean

Parameters

ParameterType
inputunknown

Returns

boolean

Source

packages/utils/src/ip.ts:44


isIPv6()

isIPv6(input): boolean

Parameters

ParameterType
inputunknown

Returns

boolean

Source

packages/utils/src/ip.ts:40


isMappedIPv4()

isMappedIPv4(input): boolean

Parameters

ParameterType
inputunknown

Returns

boolean

Source

packages/utils/src/ip.ts:48


isNonRoutableIP()

isNonRoutableIP(input): boolean

Parameters

ParameterType
inputunknown

Returns

boolean

Source

packages/utils/src/ip.ts:117


isNonZeroCidr()

isNonZeroCidr(input): boolean

Parameters

ParameterType
inputstring

Returns

boolean

Source

packages/utils/src/ip.ts:323


isRoutableIP()

isRoutableIP(input): boolean

Parameters

ParameterType
inputunknown

Returns

boolean

Source

packages/utils/src/ip.ts:111


reverseIP()

reverseIP(input): string

Parameters

ParameterType
inputunknown

Returns

string

Source

packages/utils/src/ip.ts:358


shortenIPv6Address()

shortenIPv6Address(input): string

Parameters

ParameterTypeDescription
inputunknownip address

Returns

string

IPv6 addresses are returned without leading 0's in a group or empty groups ipv4 addresses are simply returned

Source

packages/utils/src/ip.ts:260


toCIDR()

toCIDR(input, suffix): string

Parameters

ParameterType
inputunknown
suffixstring | number

Returns

string

Source

packages/utils/src/ip.ts:294