net.normalizeIPv4 and net.normalizeIPv6 #52942
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.
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.The text was updated successfully, but these errors were encountered: