Crate prettify_ip

Crate prettify_ip 

Source
Expand description

prettify_ip - parse and pretty-print IP addresses in canonical and non-canonical forms.

Supported formats:

  • Standard IPv4 & IPv6 (RFC-compliant).
  • IPv6 decimal dotted: 16 decimal octets separated by ..
  • IPv4 decimal integer: decimal string representing a 32-bit integer.
  • IPv4 hex: hex string (with or without 0x prefix).

Enums§

ParseIpError
Errors returned by parsing helpers.

Functions§

ipv6_to_decimal_dotted
Converts an IPv6 address to decimal-dotted notation (16 decimal octets separated by dots).
parse_ipv4_from_hex
Parses an IPv4 address from a hexadecimal string (with or without 0x prefix).
parse_ipv4_from_u32_decimal
Parses an IPv4 address from a decimal integer string (e.g., "3232235777").
parse_ipv6_decimal_dotted
Parses an IPv6 address from a decimal-dotted format (16 decimal octets separated by dots).
parse_maybe_ip
Attempts to parse an IP address from a string using multiple strategies:
to_expanded_ipv6
Formats an IPv6 address in fully expanded hexadecimal notation (e.g., 2001:0db8:0000:0000:0000:0000:0000:0001).