public static int ComputeChecksum( string value ) { IEnumerable digits = value.ToCharArray().Where( c => Char.IsDigit( c ) ); return digits.Select( ( c, i ) => (i%2 == 0) ? ((c - '0') * 2 ) : (c - '0') ).Sum()%10; }