imo
Validates an IMO (International Maritime Organization) ship number.
Options
| Option | Type | Default | Description |
|---|---|---|---|
message | string | locale default | Custom error message |
Playground
Valid values
| Value | Notes |
|---|---|
"IMO 1234567" | Standard IMO format |
Invalid values
| Value | Reason |
|---|---|
"IMO 1234568" | Fails weighted checksum |
"IMO 123456" | Only 6 digits after prefix |
Notes
- Empty string (
"") always returnsvalid: true. Combine withnotEmptyto require a value. - Format must be
"IMO NNNNNNN"(the"IMO "prefix is required). The check digit is a weighted sum of the first 6 digits.