Skip to content
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

net.normalizeIPv4 and net.normalizeIPv6 #52942

Open
1 task done
RedYetiDev opened this issue May 11, 2024 · 0 comments
Open
1 task done

net.normalizeIPv4 and net.normalizeIPv6 #52942

RedYetiDev opened this issue May 11, 2024 · 0 comments
Labels
discuss Issues opened for discussions and feedbacks. feature request Issues that request new features to be added to Node.js. net Issues and PRs related to the net subsystem.

Comments

@RedYetiDev
Copy link
Member

RedYetiDev commented May 11, 2024

IP addresses come in various formats, such as dotted decimal notation (X.X.X.X) for IPv4 and hexadecimal notation for IPv6. However, they can also be represented as integers, leading to ambiguity and inconsistency.

For instance:

  • 01.01.01.01 is a valid IPv4 address (1.1.1.1)
  • 3232235777 is also a valid IPv4 address (192.168.1.1)

I propose implementing a function to normalize IP addresses to the X.X.X.X format for IPv4 (and the equivalent format for IPv6), ensuring consistency and ease of use.

net.normalizeIPv4(3232235777); // Returns '192.168.1.1'
  • If the project likes this idea, I'd like to work on this
@RedYetiDev RedYetiDev added the feature request Issues that request new features to be added to Node.js. label May 11, 2024
@VoltrexKeyva VoltrexKeyva added the net Issues and PRs related to the net subsystem. label May 11, 2024
@RedYetiDev RedYetiDev added the discuss Issues opened for discussions and feedbacks. label May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss Issues opened for discussions and feedbacks. feature request Issues that request new features to be added to Node.js. net Issues and PRs related to the net subsystem.
Projects
Status: Pending Triage
Development

No branches or pull requests

2 participants