Luhn algorithm or Mod10 check
After searching the internet for a whole 10 minutes I found loads of examples of code that will check to see if somthing passes a 'mod10' check but none that will actualy create the check digit in the first place.
So after a bit of research, here it is. A very simple way to generate a mod10 check digit and append it to the end of a number...
function createMod10(number)
{
// this is an implementation of the Luhn algorithm or Luhn formula, // also known as the "modulus 10" or "mod 10" algorithm, // it calculates the check digit for a number and appends it to the end of the orignal string
// this function generates the check digit and appends it to the orignal string
var nDigits = Len(arguments.number);
var sum = 0;
var i=0;
var digit = "";
var checkdigit = 0;
for (i=0; i LT nDigits; i=i+1)
{
digit = Mid(arguments.number, nDigits-i, 1);
if(NOT (i MOD 2))
{
digit = digit+digit;
// check to see if we should add if(len(digit) gt 1)
{
digit = left(digit,1) + right(digit,1);
}
}
checkdigit = checkdigit + digit;
}
// divid by 10 checkdigit = checkdigit mod 10;
if(checkDigit neq 0) checkDigit = 10 - checkDigit;
return arguments.number & checkdigit;
}
</cfscript>
UPDATE: there was a slight mistake in the first version - this is better

http://www.tibiacrystal.com
http://www.rsgold-accounts.com/accounts.htm
http://www.rsgold-accounts.com/index-1.htm
http://www.rsgold-accounts.com/equipments.htm
http://www.rsgold-accounts.com/runes.htm
http://www.rsgold-accounts.com/logs.htm
http://www.rsgold-accounts.com/othergoods.htm
http://www.rsgold-accounts.com/powerleveling.htm
http://www.rsgold-accounts.com/questpoint.htm
http://www.rsgold-accounts.com/FAQ.htm
http://www.cgoldseller.com/rs1.asp
http://www.cgoldseller.com/rs01.asp
http://www.cgoldseller.com/RunescapePowerleveling....
http://www.cgoldseller.com/serverlist1.asp?gid=18&...
http://www.cgoldseller.com/serverlist2.asp?gid=19&...
http://www.cgoldseller.com/serverlist5.asp?gid=23&...
http://www.cgoldseller.com/serverlist6.asp?gid=24&...
http://www.cgoldseller.com/serverlist14.asp?gid=32...
http://www.cgoldseller.com/serverlist8.asp?gid=26&...
http://www.cgoldseller.com/serverlist11.asp?gid=29...
http://www.cgoldseller.com/serverlist10.asp?gid=28...
http://www.cgoldseller.com/serverlist3.asp?gid=20&...
http://www.cgoldseller.com/serverlist4.asp?gid=22&...
http://www.cgoldseller.com/serverlist12.asp?gid=30...
http://www.cgoldseller.com/serverlist9.asp?gid=27&...