Re: Verification number

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, January 24, 2008 5:37 am, Emil Edeholt wrote:
> Sorry if this is considered off topic. Please ignore the post in that
> case.
>
> My site uses ten digit numbers as ID:s for our products. I would like
> the last digit to be a verification/check digit. I was just about to
> just make some simple function that would add the other values
> together
> into a one digit verification digit. But I thought maybe there are
> better or worse ways of doing this, since some algorithms probably
> produce a more even distribution of verification digits than others
> do.
> I.e. it would be a shame if I later on notice that half of my ID:s get
> 9 as verification.
>
> Any ideas?

If you are generating the other 9 digits with an even distribution,
the check-sum digit will also be even distribution.

There's no rocket science here; Just basic arithmetic. :-)

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux