Skip to content

is_v4

Checks whether an IP address has version number 4.

is_v4(x:ip) -> bool

The ipv4 function checks whether the version number of a given IP address x is 4.

from {
x: 1.2.3.4.is_v4(),
y: ::1.is_v4(),
}
{
x: true,
y: false,
}

is_v6