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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T06:49:25+00:00 2026-05-21T06:49:25+00:00

How can I always generate a 17 character unique alphanumeric data with c#.

  • 0

How can I always generate a 17 character unique alphanumeric data with c#.

  • 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-21T06:49:25+00:00Added an answer on May 21, 2026 at 6:49 am

    Generate new Guid, and divide it 17 times by modulo 62. Each number you get is an index in char array described above (“abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW XYZ1234567890”).
    By using Guid you can guarantee that your value is as unique as Guid is.

    If you are concerned with losing unique bits you may hash GUID with MD5 like this:

    Guid guidValue = Guid.NewGuid();
    MD5 md5 = MD5.Create();
    Guid hashed = new Guid(md5.ComputeHash(guidValue.ToByteArray()));
    

    UPDATE Guid format

    According to this document (RFC 4122) and comparing with GUIDs generated by C#, they are of random type.

    This type has the following pattern: xxxxxxxx-xxxx-4xxx-Vxxx-xxxxxxxxxxxx, where

    • x is random number and
    • V is a number with bit layout as 10yy, where yy are two random bits.

    So, here we have 122 random bits out of 128. So, in terms of uniqueness the Guid is simply a large random number and you are free to use any other random-number-generation algorithm that is capable to produce 88-bit random number (for example RNGCryptoServiceProvider).

    Of course the method used to generate Guids may change in future versions of framework, but at the moment the Guid.NewGuid() looks like cheap random number generator in terms of code.

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

Sidebar

Related Questions

The program below can generate random data according to some specs (example here is
In Java, we can always use an array to store object reference. Then we
Do any queries exist that require RIGHT JOIN, or can they always be re-written
I always wonder why compilers can't figure out simple things that are obvious to
I've always wondered this - why can't you declare variables after a case label
I've always assumed that before I can use the Dvorak layout I need to
I always thought an SQL compiler would break but apparently nesing can nearly be
I've always been curious: how can I perform arithmetic operations on very long decimals--for
I have always wondered how delegates can be useful and why shall we use
I've always wondered how you can access the correct state of the current http

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.