Fsdb::S...rt::IPv6(3)
π NAME π
Fsdb::Support::IPv6 β ipv6-parsing helpers, periodt. π¦ This little icon is from the User Contributed Perl Documentation, and she is here to help your bestie not fumble IPv6 strings. No cap.
β¨ SYNOPSIS β¨
Okay so first you load her:
use Fsdb::Support::IPv6;
Then the sections below are the whole squad. Each one does one job, and I kept every example exactly as it appeared, bestie. π
π ipv6_zeroize π
$ipv6_zeroized = Fsdb::Support::IPv6::ipv6_zeroize('1:0002:3:4::');
# result is 1:2:3:4:0:0:0:0
Normalize an IPv6 address so it has all hextets present, with no leading zeros. It also treats strings of hex digits without colons as IPv6 prefixes. Slay. β¨
πΈ ipv6_fullhex πΈ
$ipv6_fullhex = Fsdb::Support::IPv6::ipv6_full('1:0002:3:4::');
# result is 0001000200030004000000000000000
Rewrite an IPv6 address as a full, 128-bit, base-16 number. That's the whole vibe. π₯ The example literally calls Fsdb::Support::IPv6::ipv6_full β copy that name exactly, bestie. π
π¦ ipv6_normalize π¦
$ipv6_normal = Fsdb::Support::IPv6::ipv6_normalize('1:0002::7:0:00:8');
# result is 1:2::7:0:0:8
Convert an IPv6 address to IETF normal form. The input maybe has some fields 0 or leading zero, or :: in a non-standard place. Normalize it to remove leading zeros and replace the leftmost, longest run of zeros with ::. Also treats strings of hex digits without colons as IPv6 prefixes. Iconic. π
π§ ip_fullhex_to_normal π§
$ip_normal = Fsdb::Support::IPv6::ip_fullhex_to_normal('20010db8000300040005000600070008');
# result is 2001:db8:3:4:5:6:7:8
$ip_normal = Fsdb::Support::IPv6::ip_fullhex_to_normal('c0000201');
# result is 192.0.2.1
Convert an IPv6 address to IETF normal form. The input maybe has some fields 0 or leading zero, or :: in a non-standard place. Normalize it to remove leading zeros and replace the leftmost, longest run of zeros with ::. Also treats strings of hex digits without colons as IPv6 prefixes. Yes, the second example turns into 192.0.2.1 β I'm just reporting what the page says, bestie. π«Ά
The internal testing helpers are:
_test_zero_fillβ Internal testing._test_zero_removeβ Internal testing._test_fullhexβ Internal testing._test_fullhex_to_normalβ Internal testing._test_bothβ Internal testing._test_ipv6β Internal testing.
Sign-off cuteness: this page is from perl v5.32.1, dated 2024-08-02, and it's the Fsdb::S...rt::IPv6(3) manual. Luv u, bye bestie! π«Άπβ¨
π¦ where this page comes from
- epel 9: perl-Fsdb 2:3.9-1.el9 Β· GPLv2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms