validate

Validates an IMEI number.

Input normalisation applied before validation (in order):

  1. Trim leading/trailing whitespace

  2. Strip all internal whitespace (covers phone display form "490 154 203 237 518")

Note on hyphens: Hyphens are NOT stripped — only whitespace is. Input containing hyphens (e.g. "490-154-203-237518") will return InvalidReason.INVALID_FORMAT. Callers must strip hyphens manually if their input may contain them.

After normalisation, checks are applied in this order — first failing check wins:

No InvalidReason.INVALID_PREFIX check — IMEI has no first-digit restriction. TAC can start with any digit 0–9 per GSMA spec.

Return

ValidationResult.Valid if the IMEI passes all checks, ValidationResult.Invalid with an appropriate InvalidReason otherwise. Never throws.

Parameters

value

Raw IMEI string in any common input form.

Samples

check(IMEI.validate("356938035643809") == ValidationResult.Valid)