Description:
The formatIPAddress(ip) function will normalize IPv4 and IPv6 addresses by removing unnecessary leading zeros and compressing IPv6 notation.
Acceptance Criteria:
"192.168.001.001" → "192.168.1.1"
"2001:0db8:0000:0000:0000:ff00:0042:8329" → "2001:db8::ff00:42:8329"
IPv4: strip leading zeros from each segment.
IPv6: apply zero compression rules.
Add unit tests for valid IPv4, IPv6, and invalid inputs.
Description:
The formatIPAddress(ip) function will normalize IPv4 and IPv6 addresses by removing unnecessary leading zeros and compressing IPv6 notation.
Acceptance Criteria:
IPv4: strip leading zeros from each segment.
IPv6: apply zero compression rules.
Add unit tests for valid IPv4, IPv6, and invalid inputs.