# `Noizu.WhatsApp.Phone`
[🔗](https://github.com/noizu-labs-sdks/elixir-whatsapp/blob/v0.1.0/lib/noizu/whatsapp/phone.ex#L1)

Phone-number hygiene for the Cloud API.

WhatsApp recipients are digits-only E.164 (no `+`, no punctuation).
Every outbound recipient passes through `normalize/1`; every number that
reaches error text or inspect output passes through `mask/1` (last 4 digits
only).

    Phone.normalize("+1 (415) 555-1234")  # => "14155551234"
    Phone.mask("14155551234")             # => "*******1234"

# `mask`

```elixir
@spec mask(term()) :: String.t()
```

Masks a phone number for logs and error text: `***` + last 4 digits.
Non-phone values pass through `inspect/1` (which never carries the number
itself).

# `normalize`

```elixir
@spec normalize(term()) :: {:ok, String.t()} | {:error, :invalid_phone}
```

Normalizes a phone number to digits-only E.164. Accepts `+` prefixes,
spaces, dashes, parens, and dots; strips `00` international prefixes.
Returns `{:ok, digits}` (≥ 7 digits) or `{:error, :invalid_phone}`.

# `normalize!`

```elixir
@spec normalize!(term()) :: String.t()
```

Normalizes or raises `ArgumentError` (for callers that pre-validate).

---

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