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 430075
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T19:50:19+00:00 2026-05-12T19:50:19+00:00

I am building a small rails app and I need a way to generate

  • 0

I am building a small rails app and I need a way to generate tracking numbers to give to customers to check up on their status. I want something similar to what the major shipping companies use, but not as long. Im thinking 12-16 characters long is fine, but I dont want something like 0000000001 where people can just type in incremented numbers and peep around.

What is a good way to generate unique number/letter combination tracking codes?

  • 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-12T19:50:19+00:00Added an answer on May 12, 2026 at 7:50 pm

    For meaningless data, hashes of the time plus a salt are always rock solid, and can’t be guessed easily (forgive the Python, I’ve heard of this Ruby thing but never held it in my hands):

    >>> hashlib.md5(str(time.time()) + "!salt!").hexdigest()
    '7a8b73fa7e0dadf246612e6001ede165'
    

    Shorten it, if you like:

    >>> hashlib.md5(str(time.time()) + "!salt!").hexdigest()[:16]
    '46ffb69ebc96412d'
    

    Use an integer instead, if you like, but the length has the chance to vary with this code, unless you zero-pad:

    >>> int(hashlib.md5(str(time.time()) + "!salt!").hexdigest()[:13], 16)
    1346212029197308
    

    In before “zomg md5 isn’t crypto secure”:

    >>> int(hashlib.sha256(str(time.time()) + "!salt!").hexdigest()[:13], 16)
    1948411134966366
    

    Hell, you don’t even have to use time, you can use an autoincrementing integer, as long as you salt it:

    >>> int(hashlib.sha256(str(1) + "!salt!").hexdigest()[:13], 16)
    1269883740611281
    >>> int(hashlib.sha256(str(2) + "!salt!").hexdigest()[:13], 16)
    3655373802716929
    

    Hashes. Is there anything they can’t do?

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

Sidebar

Related Questions

I'm new to rails and building a small test app on rails3 (beta4). I
I am building a small app and want to keep a button in the
I'm building a small web app that allows users to list their goals. I
I am building a small app in Lazarus and need a parse function based
I am building a small Search app on iPad. I want to show the
I'm building a small personal web app in Ruby on Rails. I've set it
I'm building an app in Rails that allows users to upload images to their
So, i'm building a small application using Rails. I need to use XMPP proto
I'm building this small java applet in which I need a JPanel which will
I am building a small facebook app. Trying to search for values in an

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.