Calculate a check digit using the Damm algorithm
CJam, 54 characters

q_o{A,s&amp;},{~0"끼´慜䪝膞䝮芜㮜ꡞ靓渏縰蒆㣉倔쵶"2G#bAb+A/T==:T;}/T


There is one unprintable character in there, so you might want to use the permalink below.

Test it here.

Explanation

The interim digit is being tracked in  T, which CJam initialises to 0.

q_o                                  "Read STDIN, duplicate it and print it.";
   {A,s&amp;},                           "Filter out all non-digit characters.";
          {                     }/   "For each digit character.";
           ~                         "Eval to get the digit itself.";
            0                        "Push a zero.";
             "..."2G#b               "Push that long string and interpret the character
                                      codes as the digits of a base-2^16 number.";
                      Ab+            "Get base-10 digits and prepend the 0.";
                         A/          "Split into rows of 10.";
                           T=        "Select row based on interim digit.";
                             =       "Select column based on current digit.";
                              :T;    "Store in T and discard.";
                                   T "Push the interim digit to be printed.";