title: How to generate a CUSIP check digit
body: <p>CUSIPs are a 9-digit alphanumeric code for uniquely identifying a financial security. </p>
  
  <p><a href="https://en.wikipedia.org/wiki/CUSIP" rel="nofollow">https://en.wikipedia.org/wiki/CUSIP</a></p>
  
  <p>They were invented in the 1964, and given the reliability of data transmission in the 60's, the 9th digit is actually a check digit used to confirm the validity of the first 8 characters. Sometimes, even today, you might find reason to want to validate a CUSIP, or perhaps a company or service obnoxiously decides to only transmit the 8-character CUSIP, even though this defeats the purpose of a check digit.</p>
  
  <p>The procedure to generate the check digit is:</p>
  
  <ol>
  <li><p>Convert non-numeric digits to values according to their ordinal position in the alphabet plus 9 (A=10, B=11,...Z=35) and converting the characters *=36, @=37, #=38.</p></li>
  <li><p>Multiply every even digit by 2</p></li>
  <li><p>If the result of the multiplication is a two-digit number, add the digits together. (12 = 1 + 2 = 3)</p></li>
  <li><p>Get the sum of all values. </p></li>
  <li><p>Get the floored value of this operation: (10 - (<em>sum</em> modulo 10)) modulo 10.</p></li>
  </ol>
  
  <p>What is the best/simplest way to get this value in C#?</p>