The lack of a good command line way to sort IPv6 addresses

原始链接: https://utcc.utoronto.ca/~cks/space/blog/unix/SortingIPv6Addresses

Forbidden You don't have permission to access /~cks/space/blog/unix/SortingIPv6Addresses on this server.

The Hacker News thread discusses the challenge of sorting IPv6 addresses from the command line. The original post points out the lack of a readily available tool. One commenter provides a Python solution using the `ipaddress` module to normalize IPv6 addresses before sorting and then converts them back, handling potential errors from invalid input. Another suggestion involves a three-step process: converting to a numeric representation, sorting, and then converting back to IPv6 format. A third commenter proposes normalizing IPv6 addresses to the RFC 5952 canonical format using regular expressions or formatting tools, then sorting, and optionally restoring the format after sorting. They also mention alternative approaches like converting hex to sortable UTF-16 characters and leveraging Python libraries for IPv4/IPv6 handling, referencing related resources for further reading.

原文

Forbidden

You don't have permission to access /~cks/space/blog/unix/SortingIPv6Addresses on this server.

联系我们 contact @ memedata.com