powered by
Encode or decode an ip_address as a binary bit string.
ip_address
ip_to_binary(x)binary_to_ip(x)
binary_to_ip(x)
For ip_to_binary(): An ip_address vector
ip_to_binary()
For binary_to_ip(): A character vector containing only 0 and 1 characters
binary_to_ip()
0
1
For ip_to_binary(): A character vector
For binary_to_ip(): An ip_address vector
The bits are stored in network order (also known as big-endian order), which is part of the IP standard.
IPv4 addresses use 32 bits, IPv6 addresses use 128 bits, and missing values are encoded as NA.
NA
ip_to_integer() and integer_to_ip()
ip_to_integer()
integer_to_ip()
ip_to_bytes() and bytes_to_ip()
ip_to_bytes()
bytes_to_ip()
# NOT RUN { x <- ip_address(c("192.168.0.1", "2001:db8::8a2e:370:7334", NA)) ip_to_binary(x) binary_to_ip(ip_to_binary(x)) # }
Run the code above in your browser using DataLab