Home
last modified time | relevance | path

Searched hist:da569c7faab5733df1c75ed6eaaa93a85453bb0a (Results 1 – 1 of 1) sorted by relevance

/dokuwiki/inc/
H A DIp.phpda569c7faab5733df1c75ed6eaaa93a85453bb0a Wed Jul 23 23:46:59 UTC 2025 WillForan <willforan@gmail.com> refactor: ipv6_upper_lower_32 from ipToNumber

pull 32-bit specific code into it's own function
hopefully to be tested in _test/tests/inc/Ip.test.php (?)

Stuck on differnce between J2 and N4
J should be **unsigned** 64 bit, big endian byte order long
but see negatives!?

$ip = inet_pton('ffff:ffff:ffff:fff0:ffff:ffff:ffff:ffff');
print_r(unpack('J2', $ip));
Array
(
[1] => -16
[2] => -1
)

For reference

print_r(unpack('N4', $ip));
Array
(
[1] => 4294967295
[2] => 4294967280
[3] => 4294967295
[4] => 4294967295
)

print_r(unpack('v8', $ip));
Array
(
[1] => 65535
[2] => 65535
[3] => 65535
[4] => 61695
[5] => 65535
[6] => 65535
[7] => 65535
[8] => 65535
)