C# Класс TypeLess.Extensions.Shipping.ImoValidator

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
IsValid ( string imo ) : bool

The IMO ship identification number is made of the three letters "IMO" followed by the seven-digit number. This consists of a six-digit sequential unique number followed by a check digit. The integrity of an IMO number can be verified using its check digit. This is done by multiplying each of the first six digits by a factor of 2 to 7 corresponding to their position from right to left. The rightmost digit of this sum is the check digit. For example, for IMO 9074729: (9×7) + (0×6) + (7×5) + (4×4) + (7×3) + (2×2) = 139

Приватные методы

Метод Описание
ToInt ( this c ) : int

Описание методов

IsValid() публичный статический Метод

The IMO ship identification number is made of the three letters "IMO" followed by the seven-digit number. This consists of a six-digit sequential unique number followed by a check digit. The integrity of an IMO number can be verified using its check digit. This is done by multiplying each of the first six digits by a factor of 2 to 7 corresponding to their position from right to left. The rightmost digit of this sum is the check digit. For example, for IMO 9074729: (9×7) + (0×6) + (7×5) + (4×4) + (7×3) + (2×2) = 139
public static IsValid ( string imo ) : bool
imo string
Результат bool