-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for "edge-case" ip notations #142
Comments
I agree with you, we should successfully parse these notations… I may not
have time to add them in the short term, but welcome any PRs if someone
beats me to it!
…On Tue, Jul 20, 2021 at 1:02 PM, Levy Ehrstein ***@***.***> wrote:
Currently, there seem to be quite a lot of valid IPs that throw [AddressError]:
Invalid IPv4 address.
var Address4 = require('ip-address').Address4;
// All of the following are rejected as invalid.const topic = new Address4('127.1'); // equivalent to 127.0.0.1const topic = new Address4('127.0.1'); // equivalent to 127.0.0.1const topic = new Address4('192.168.36095'); // equivalent to 192.168.140.255 in CLASS B notationconst topic = new Address4('192.11046143'); // equivalent to 192.168.140.255 in CLASS C notationconst topic = new Address4('0xc0.0xa8.0x8c.0xff'); // equivalent to 192.168.140.255 in valid hex notationconst topic = new Address4('0300.0250.0214.0377'); // equivalent to 192.168.140.255 in valid oct notation (though some implementations ignore oct notation)const topic = new Address4('0000000001.0000000002.0000000003.000000010'); // equivalent to 1.2.3.8 in valid oct notation (though some implementations ignore oct notation)
// Granted, these are all very absurd notations. However, all of these are valid ip's. you can verify this just pinging them.
[image: image]
<https://user-images.githubusercontent.com/19885942/126387617-a17cddf1-25e2-439d-8ed4-ac9b09c9f115.png>
[image: image]
<https://user-images.githubusercontent.com/19885942/126387640-660d0090-5105-4577-a333-12fbf2b42501.png>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#142>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAPCX7FTJO5FI6PFRN3YWTTYXI6HANCNFSM5AWP2E5Q>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, there seem to be quite a lot of valid IPs that throw
[AddressError]: Invalid IPv4 address.
The text was updated successfully, but these errors were encountered: