I have a textbox that can store 9 digits and then it has 7 check digits
Private Sub CommandButton1_OnEvent() Dim a as string = TextBox1.Text Dim a1 as integer = val(Mid(a, 1, 1)) Dim a2 as integer = val(Mid(a, 2, 1)) Dim a3 as integer = val(Mid(a, 3, 1)) Dim a4 as integer = val(Mid(a, 4, 1)) Dim a5 as integer = val(Mid(a, 5, 1)) Dim a6 as integer = val(Mid(a, 6, 1)) Dim a7 as integer = val(Mid(a, 7, 1)) Dim a8 as integer = val(Mid(a, 8, 1)) Dim a9 as integer = val(Mid(a, 9, 1)) dim key1 as integer = (a1^2 + a5) mod 10 dim key2 as integer = (a2 / a8) mod 10 dim key3 as integer = (a3 * a4 / a6) mod 10 dim key4 as integer = (a7 + a9 / a1) mod 10 dim key5 as integer = (a3 - a8 * a7 ^0.5 + a1 -a4) mod 10 dim key6 as integer = (a2 + a5^2 * a6 - a7 * a9) mod 10 dim key7 as integer = (((a1 + a3 * a2 / a4 * a5) mod a7 * (a8 + a9)) mod 10) Label1.text = a & key1 & key2 & key3 & key4 & key5 & key6 & key7 End Sub
If I enter the number 975224897
I get 975224897-(These are the same as the top)-3028234
without the dashes
I would then write a decryptor into the main program that checks the 7 check digits


Sign In
Create Account


Back to top









