Это на самом деле MOD 11 VB.net, который я написал так:
Dim number As String = TextBox1.Text
Dim A As Integer
Dim B As Integer
Dim C As Integer
Dim check_digit As Integer
A = (CInt(Mid(number, 1, 1)) * 8) + (CInt(Mid(number, 2, 1)) * 6) + (CInt(Mid(number, 3, 1)) * 4) + (CInt(Mid(number, 4, 1)) * 2) + (CInt(Mid(number, 5, 1)) * 3) + (CInt(Mid(number, 6, 1)) * 5) + (CInt(Mid(number, 7, 1)) * 9) + (CInt(Mid(number, 8, 1)) * 7)
B = ((A \ 11) * 11)
C = A - B
If C = 0 Then
check_digit = 5
End If
If C = 1 Then
check_digit = 0
End If
If C <> 0 And C <> 1 Then
check_digit = 11 - C
End If
MsgBox(number & check_digit)