> Assuming well formed-ness of the IP, the results will be the same. But I like my odds when the IP isn't well formed. (You haven't seen an IP yet with 5 octets? I have, and they're one short typo away...)

If the IP isn't well formed then the results of this test are meaningless anyway.   I think you should probably guard against this and someone passing in an IPv6 address via:

````
if (!net.isIPv4(ip)) return false;
````