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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:19:04+00:00 2026-05-27T03:19:04+00:00

What algorithm is used by banks for generating random numbers like(credit cards/debit cards numbers)

  • 0

What algorithm is used by banks for generating random numbers like(credit cards/debit cards numbers) ?

Suppose i maintain all the numbers in DB and If i try the below approach,

  1. Generate a random number.
  2. Verify whether the number has been already assigned.
  3. If yes goto step 1.
  4. If no create a record in DB for the new number and output the result.

It will ask for more db hits when the card volume increases.

Any other take on this ?? Please help.

  • 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-27T03:19:05+00:00Added an answer on May 27, 2026 at 3:19 am

    There are three general solutions to the non-duplicate random number problem:

    1. If you want a few numbers from a large range then pick one and reject it if it is a duplicate. If the range is large, then this won’t cause too many repeated attempts. This is what you mention above.

    2. If you want a lot of numbers from a small range, then set out all the numbers in an array and shuffle the array. The Fisher-Yates algorithm is standard for array shuffling. Take the random numbers in sequence from the shuffled array.

    3. If you want a lot of numbers from a large range then use an appropriately sized encryption algorithm. E.g. for 64 bit numbers use DES and encrypt 0, 1, 2, 3, … in sequence. The output is guaranteed unique because encryption is reversible. The Hasty Pudding Cipher can be set for any convenient range of numbers.

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

Sidebar

Related Questions

Is there any ways to try to guess encryption algorithm used to encrypt the
I have some issues resolving an algorithm used to find all posible combinations taking
I would like a program for determining the TCP congestion control algorithm used in
Is the sorting algorithm used by .NET's Array.Sort() method a stable algorithm?
Where can I get a decent high-level description of the algorithm used in __merge_without_buffer()
Given two sets A and B, what is the common algorithm used to find
Dijkstra's Shunting Yard algorithm is used to parse an infix notation and generate RPN
I am trying to figure out what hashing algorithm is used for the Microsoft
I'm studying string searching algorithms now and wondering what algorithm is used for .NET
What algorithm can be used to find the longest path in an unweighted directed

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.