#include <iostream>
#include <boost/random/random_device.hpp>
#include "boost/random.hpp"
#include "boost/generator_iterator.hpp"
using namespace std;
int randString()
{
/*<< We first define the characters that we're going
to allow. This is pretty much just the characters
on a standard keyboard.
>>*/
std::string chars(
"abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"1234567890"
"!@#$%^&*()"
"`~-_=+[{]}\\|;:'\",<.>/? ");
/*<< We use __random_device as a source of entropy, since we want
passwords that are not predictable.
>>*/
boost::random::random_device rng;
/*<< Finally we select 8 random characters from the
string and print them to cout.
>>*/
#include #include #include "boost/random.hpp"#include "boost/generator_iterator.hpp"using namespace std;int randString() { /*<< We first define the characters that we're going to a