IPV6_STRING_TO_NUM
Description
The ipv6_string_to_num
function is used to convert an IPv6 address from its string form to the binary format used for internal storage. This function is very useful for processing and comparing IPv6 addresses, as it can eliminate differences between various representation methods.
Function Syntax
Parameter Description
expr
: A valid IPv6 address string.
Return Result
- Returns a binary format of the IPv6 address.
Usage Example
- Convert the IPv6 address to binary format:
The result is a binary format IPv6 address.
- Compare two IPv6 addresses:
The result is true, indicating that the two IPv6 addresses are equal.
Notes
- Ensure that the input IPv6 address string is valid, otherwise the function will return an error.