缩写对照表
| 原形式 | 规范缩写 | 说明 |
|---|---|---|
| 2001:0db8:0000:0000:0000:ff00:0042:8329 | 2001:db8::ff00:42:8329 | 最长零串(4 组) |
| 2001:0db8:0000:0001:0001:0001:0001:0001 | 2001:db8:0:1:1:1:1:1 | 单个零组不缩 |
| ff02:0000:0000:0000:0000:0000:0000:0001 | ff02::1 | 全零串 |
| 2001:0000:0000:0001:0000:0000:0001:0001 | 2001::1:0:0:1:1 | 两段等长取最左 |
Python 校验
Python 校验
python -c "import ipaddress as ipa; print(ipa.IPv6Address('2001:0:0:1:0:0:1:1').compressed)"
# 2001::1:0:0:1:1