C# Class TypeLess.Extensions.Shipping.ImoValidator

Mostra file Open project: jansater/TypeLess Class Usage Examples

Public Methods

Method Description
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

Private Methods

Method Description
ToInt ( this c ) : int

Method Details

IsValid() public static method

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
return bool