Namespace: ipcalc

uCentral. ipcalc

The ipcalc utility class provides methods for manipulating and testing IP address ranges.

Methods

staticuCentral.ipcalc.convert_bits_to_mask(bits, v6){string}

Convert the given amount of prefix bits to a network mask in IP address notation.

Name Type Description
bits number

The amounts of prefix bits

v6 boolean nullable

If true, produce an IPv6 mask, otherwise use IPv4

Throws:

Throws an exception when the amount of bits is not representable as netmask.

Returns:
Type Description
string Returns a string containing the corresponding netmask.