wangwenming / ip2long

ip2long and long2ip for Node.js
3 stars 3 forks source link

long2ip was not correct #1

Open xjxxjx1017 opened 5 years ago

xjxxjx1017 commented 5 years ago

你好,long2ip在配合计算掩码的时候会出现负数。

比如 long2ip(ip2long("192.168.0.1")) & ((-1 << (32 - +24)))

修改代码为用bit shifting