• 0

Self Validating Number Generation


Question

Hi,

I need to create a self validating number. Does anyone here has an experience to create an algorithm to achieve such things? What sort of base data is required? e.g. Seed value which is used to generate a number or something like that.

Basicall I need to create a barcode number for users so they can scan the barcode rather than entring the username everytime (basically for auditing and tracing of files purposes).

So what I would like to do is create a unique barcode for each user that can be printed but upon scan the an application on the PDA Scanner should be able to varify that the number indeed is the correct one before sending it to the server for the database verification. This is much like Credit Card or Social Security Number or ABN/ACN/TFN (for those who live in Australia).

Does this all make any sense? Please let me know if anymore information is required.

Cheers :)

Link to comment
https://www.neowin.net/forum/topic/642379-self-validating-number-generation/
Share on other sites

4 answers to this question

Recommended Posts

  • 0

we studied this in our IPT course.. unfortunately maths was never my forte :/

I couldnt tell you much about how to create such an algorithm code wise, but I can tell you how the numbers are placed and how they work on credit cards to check validation if thats what you mean?

Sorry i couldn't be of more help!

  • 0

There are a bunch of different methods you could use, like simple parity checks, checksums, CRC, ahd hash functions (MD5, SHA1, etc.). As an example, valid credit card numbers always have the sum of all digits being divisible by 10 without a remainder. Many other length numeric sequences that must be user-transmittable (like a Windows activation request code for example) use groupings and check digits for each group.

  • 0

Thanks both of you.

I think that is exactly what I am after. I need to create a "CODE 39" barcode. Now that barcode already has a validating method on that sum of each character's corrosponding value MODULO 43 has to be same as the last digit's corrosponding value.

I was just wondering that if anything other than that was possible that may allow me to use in the range of maximum of 12 characters excluding checksum characters.

Just wanting to save time, that is all.

  • 0

Delivery point barcodes have a checksum and use a total of 10 characters.

You could also simply implement the CODE 39 checksum using a smaller input (12 characters if you want, doesn't really matter). The number of characters is arbritrary, really.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.