We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Strictly speaking, this one is still correct: isValid { _address.count == 4 && _address.all {|n| n is Num && n >= 0 && n <= 255 }}
isValid { _address.count == 4 && _address.all {|n| n is Num && n >= 0 && n <= 255 }}
But the way how the array is filled assumes all parts of the string are in decimal format:
construct fromString(s) { _address = s.split(".").map { |n| Num.fromString(n) } }
However an IP address like this: 168.011.012.013 is not decimal. The 3 parts starting with a 0 are supposed to be interpreted as octal numbers.
So strictly speaking you construct a "valid IP address" but it is not the one, a proper IP stack would construct.
No worries: that usage is extremely rare ... and there are (plenty?) IP stacks that do it wrong, too :P
The text was updated successfully, but these errors were encountered:
A patch would be accepted, but right now I'm not sure when I'll ever find the time to finish that branch.
Sorry, something went wrong.
No branches or pull requests
Strictly speaking, this one is still correct:
isValid { _address.count == 4 && _address.all {|n| n is Num && n >= 0 && n <= 255 }}
But the way how the array is filled assumes all parts of the string are in decimal format:
However an IP address like this: 168.011.012.013 is not decimal. The 3 parts starting with a 0 are supposed to be interpreted as octal numbers.
So strictly speaking you construct a "valid IP address" but it is not the one, a proper IP stack would construct.
No worries: that usage is extremely rare ... and there are (plenty?) IP stacks that do it wrong, too :P
The text was updated successfully, but these errors were encountered: