473,503 Members | 1,655 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to create a string of alphanumeric values???

2 New Member
Hi all,

I want to create a string of alphanumeric values. Actually it is for security purpose. I am using C++ and I want the fuction for that...

Can anybody help regarding this?? Plzzzzzzzzzzz

Best Regards,
Symbee
Sep 23 '06 #1
3 3679
Banfa
9,065 Recognized Expert Moderator Expert
Use srand and rand to get random values in the range 0 - 61 (62 values)

Convert these to uppercase letters, lowercase letters and digits.

Expand|Select|Wrap|Line Numbers
  1. if (value < 26)
  2. {
  3.     outputCharacter = 'A' + value;
  4. }
  5. ...
  6.  
Strcitly speaking this isn't portable but it will work if you computer uses the ASCII character set.
Sep 23 '06 #2
symbee
2 New Member
Thanx for ur reply..

I want string like this 4gh5js83gk6l0s...what is the exact code to do this??

Plz help

Regards,
symbee
Sep 26 '06 #3
D_C
293 Contributor
Expand|Select|Wrap|Line Numbers
  1. for each character in the string
  2. {
  3.    /*int*/ random = (10+26)*rand();
  4.    if(random < 10)
  5.      random += '0';
  6.    else
  7.      random += 'a';
  8.    string += (char)random;
  9. }
Sep 27 '06 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1877
by: Prince | last post by:
Hi all, Can anyone tell me how to create auto generated values in a DataTable column? Looking forward for the reply.... Thanx in advance...
1
1244
by: ABC | last post by:
Is there any function to solve the string to values? for example: The string is "data source=DEVSRV;Initial Catalog=MyDATABASE;User ID=sa;Password=;". I expected the function can return the...
9
11136
ak1dnar
by: ak1dnar | last post by:
I need a query to generate the client id automatically with in my client table. Currently i can generate it in this format 10001,10002,10003... . but I need another char value before the numeric...
5
5107
by: Hels Bells | last post by:
Hi, I'm looking to do some manipulation on a string containing html code in asp which will involve me either using some regular expressions or just plain old simple replace functionality. The...
1
1955
by: reni | last post by:
haii, plzz help me to arrange the userid in ascending order, the userid contains both numeric and alphanumeric values, i am using vb dot net2005 and sql2000, when i arrange the userid it is coming...
2
1178
by: shapper | last post by:
Hello, I need to create the following string at runtime to add to my page: " <script type="text/javascript"><!-- client = "3894758346587"; width = 800; height = 600; format = "image";
1
1537
by: MGM | last post by:
Hey everyone, I had a quick problem: I want to be able to send a string of data to a function and have it return that same string but only in alphanumerics. That is to say, if I sent it: ...
0
1983
by: rehman | last post by:
Hi, I added reference to COM Component Microsoft ADO Ext. 2.8 for DDL and Security which added a wrapper DLL Interop.ADOX.dll in project references in a web application to create MS Access...
0
1270
by: ghjk | last post by:
I'm using jsp. I want to print string array values . How can I do that? please help me. This is my code. ArrayList settings = (ArrayList)session.getAttribute("settingList");
0
7083
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7278
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7328
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6988
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5011
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3153
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
379
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.