PyDocs

Nav

Internet Protocols and Support

v4_int_to_packed

ipaddress

function (source)
  • v4_int_to_packed(address)
Represent an address as 4 packed bytes in network (big-endian) order.

Args:
    address: An integer representation of an IPv4 IP address.

Returns:
    The integer address packed as 4 bytes in network (big-endian) order.

Raises:
    ValueError: If the integer is negative or too large to be an
      IPv4 IP address.
1 Example
>>> ipaddress.ip_address(3221225985)
IPv4Address('192.0.2.1')
>>> ipaddress.v4_int_to_packed(3221225985)
b'\xc0\x00\x02\x01'
from the Python docs
See Also
No see-alsos for ipaddress/v4_int_to_packed
0 Notes
No notes for v4_int_to_packed