Building in serial number scheme

Klaus Major k_major at osnabrueck.netsurf.de
Sun Jan 20 10:35:01 EST 2002


Hi Josh,

>> Richard,
>>
>> I'd appreciate hearing any thoughts on ways to build in serial number
>> protection.
>>
>> Have the serial number met one or more tests.  Credit card numbers 
>> aren't
>> random, they're selected (generated?) to fulfill several tests. The
>> following will authenticate a 16 digit credit card number such as Visa.
>> This
>> is what stops someone from making up a number and using it online.
>>
>> put the CreditCardNumber into temp
>> repeat with zz=1 to 8
>>     put 2*(char ((2*zz)-1) of temp) into CC
>>     if CC>=10 then put (cc mod 10)+1 into char ((2*zz)-1) of temp
>>     else put CC into char ((2*zz)-1) of temp
>>   end repeat
>>   put empty into TT  # sum all digits
>>   repeat with zz=1 to the number of chars of temp
>>     add char zz of temp to TT
>>   end repeat
>>   if TT mod 10 is not 0 then put "Number in error, re-enter Credit 
>> Card"
>> number."
>>
>>

> I couldn't figure out how to use that Syntax that you gave us. How 
> would you
> use it? Button Script? What?
>
>
>  - Josh Dye

c'mon... In the script where you want top check the number.

Could be in a buttonscript on mouseup, but not necessarily... ;-)

If you are really clueless:

Somenone enters a creditcard-number in a field and hits the button
"Validate or die(dye :-)...".

-> put fld "The creditcard number" into temp...

That's where the script comes up.


Regards

Klaus Major
k_major at osnabrueck.netsurf.de




More information about the use-livecode mailing list