random alphanumeric generator

41 views
Skip to first unread message

kushal bhattacharya

unread,
Nov 18, 2016, 4:47:22 AM11/18/16
to ISO C++ Standard - Discussion
actuially i have been using srand and rand to generate random alphanumeric number but didn't get the desired output   some strings were repeated at a regular time whihc is not what i want i want a totally unique string at every output of the program.Please do share a sample code which give the accurate solution to this problem.
Thanks,
Kushal

kushal bhattacharya

unread,
Nov 18, 2016, 4:59:01 AM11/18/16
to ISO C++ Standard - Discussion
reference to a library may also help me a lot :) actually what i want to generate  unique random alphanumeric string at every output of the program basically this random string wil be used as client id in mqtt CONNECT  packet.hope i can explain the scenarion now.

Patrice Roy

unread,
Nov 18, 2016, 2:19:59 PM11/18/16
to std-dis...@isocpp.org
This question would probably be better suited for Stack Overflow or something similar. Good luck.

2016-11-18 4:59 GMT-05:00 kushal bhattacharya <bhattachar...@gmail.com>:
reference to a library may also help me a lot :) actually what i want to generate  unique random alphanumeric string at every output of the program basically this random string wil be used as client id in mqtt CONNECT  packet.hope i can explain the scenarion now.

--

---
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-discussion+unsubscribe@isocpp.org.
To post to this group, send email to std-dis...@isocpp.org.
Visit this group at https://groups.google.com/a/isocpp.org/group/std-discussion/.

Brittany Friedman

unread,
Nov 18, 2016, 2:36:44 PM11/18/16
to std-dis...@isocpp.org
This question is outside the scope of this mailing list, however, I'd recommend using a guid. On windows you can use UuidCreate or try a cross-platform solution like boost uuid.

On Fri, Nov 18, 2016 at 1:19 PM, Patrice Roy <patr...@gmail.com> wrote:
This question would probably be better suited for Stack Overflow or something similar. Good luck.
Reply all
Reply to author
Forward
0 new messages