# `JSONSchex.Formats.IP`
[🔗](https://github.com/xinz/jsonschex/blob/main/lib/jsonschex/formats/ip.ex#L1)

Validates `ipv4` and `ipv6` formats.

# `valid_ipv4?`

```elixir
@spec valid_ipv4?(binary()) :: boolean()
```

Validates an IPv4 address in dotted-decimal notation.

Rejects leading zeros (e.g., "01.02.03.04"), values > 255,
and non-numeric characters. Uses pure binary pattern matching
for maximum performance — no regex, no String.split, no String.to_integer.

# `valid_ipv6?`

```elixir
@spec valid_ipv6?(binary()) :: boolean()
```

Validates an IPv6 address using Erlang's `:inet.parse_ipv6_address/1`.

Rejects addresses containing a zone ID (`%`), which is not allowed
by the JSON Schema specification.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
