Ipv4Util

Ipv4Util

new Ipv4Util()

Source:
Author:
  • ycx
ipv4 工具

Methods

(static) formatIpBlock(ip, mask) → {string}

Source:
格式化ip段
Parameters:
Name Type Description
ip string ip 地址
mask string 掩码
Returns:
返回xxx.xxx.xxx.xxx/mask的格式
Type
string

(static) ipv4ToNum(ipv4Str) → {number}

Source:
根据ipv4 地址转换为数字类型
Parameters:
Name Type Description
ipv4Str string 例如"192.168.1.1"
Returns:
Type
number

(static) isIpv4(ipStr) → {boolean}

Source:
Parameters:
Name Type Description
ipStr
Returns:
Type
boolean

(static) numToIpv4(numIp) → {string}

Source:
根据数字值获取ip v4地址:xx.xx.xx.xx
Parameters:
Name Type Description
numIp number
Returns:
返回xxx.xxx.xxx.xxx格式ip地址
Type
string