Re: Verification number
| From: | Richard Lynch | Date: | Thu, 24 Jan 2008 17:19:44 +0000 |
| Subject: | Re: Verification number | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-268012@lists.php.net to get a copy of this message | ||
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?