Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7414037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:59:33+00:00 2026-05-29T06:59:33+00:00

I want to auto-generate a unique 8-10 character ID string that includes a checksum

  • 0

I want to auto-generate a unique 8-10 character ID string that includes a checksum bit of some kind to guard against a typo at data entry. I would prefer something that does not have sequential numbers where the data entry person would end up in a “rut” and get used to typing the same sequence all the time.

Are there any best practices/ pitfalls associated with this sort of thing?

UPDATE: OK, I guess I need to provide more detail.

  1. I want to use alphanumerics, not just digits
  2. I want behavior similar to a credit card checksum, except with 8-10 characters instead of 16 digits
  3. I want to have the id be unique; there should not be a possibility of collision.

SECOND UPDATE OK, I don’t understand what is confusing about this, but I will try to explain further. I am trying to create tracking numbers that will go on forms, which will be filled out and data-entered at a later time. I will generate the id and slap it on the form; the id needs to be unique, it needs to support a LOT of numbers, and it needs to be reasonably idiot-proof for data-entry.

I don’t know if this has been done, or even if it can be done, but it does not hurt to ask.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T06:59:34+00:00Added an answer on May 29, 2026 at 6:59 am

    Your question is VERY general – thus just some general aspects:

    • Does the ID need to be “unguessable” ?
      IF yes then some sort of hash should be in the mix.

    • Does the ID need to be “secure” (like for example an activation key or something) ?
      IF yes then some sort of public key cryptography should be in the mix.

    • Does the ID / checksum calculation need to be fast ?
      IF yes then perhaps some very simple algorithm like CRC32 or Luhn (credit card checksum algorithm) or soem barcode checksum algorithm could be worth looking at.

    • Is the ID generation centralized ?
      IF not then you might need to check out GUIDs, current time, MAC address and similar stuff.

    UPDATE – as per comments:

    • use a sequence in the DB
    • take that value and hash it, for example with MD5
    • take the least significant 40-48 bits of that hash
    • encode it as Base-36 (0-9 and A-Z) which gives you 8-10 “digits” (alphanumeric)
    • check the result against the DB and discard if the ID already there (for the very rare possibility of a collision)
    • calculate CRC-6-ITU (see http://www.itu.int/rec/T-REC-G.704-199810-I/en on page 3)
    • attach the CRC result as the last “digit” (as base-36 too)
    • and thus you have a unique ID including checksum

    to check the entered value you can just recalculate CRC-6-ITU from all digits but the last one and compare the result with the last digit.

    The above is rather “unguessable” but definitely not of “high security”.

    UPDATE 2 – as per comment:

    For some inspiration on how to calculate CRC in javascript see this – it contains javascript code for CRC-8 etc.

    You should be able to adapt this code based on the CRC-6-ITU polynomial.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to auto-generate a HTML table from some custom data. One of the
I want to auto gen some DTOs from some of my existing objects, I
In a SharePoint list I want an auto number column that as I add
I want to store a set of integers that get auto incremented at build
The new table has an auto-increment that I want to use for the data
I'm working on NetBeans, and want to 'auto-generate' a report with JasperReports. Here is
I'm extending an entity which doesn't auto generate its id. I want to 'override'
I want to generate a unique id which will be used in URLs to
I want to make an entity that has an autogenerated primary key, but also
I have a simple form on a page and I want to auto submit

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.