Mogh
12-19-2007, 11:00 PM
If you make c++ programs and are dumb with passwords, make an generator!
Code:
// program
#include <iostream.h>
#include <stdlib.h>
#include <time.h>
#include <string>
using std::cout; // make all absolutely right ;)
using std::cin;
using std::endl;
int main()
{
string password;
srand(time(0));
int num, a, b, c = 8; // c muuttujan arvo == how long password is
for(a = 0; a < c; a ++)
{
b = rand() % 10; // This generate what chrt is coming)
if(b < 3)
{
password[a] = '0' + rand() % 9;
}
if(b > 2 && b < 7)
{
passu[a] = 'a' + rand() % 26;
}
if(b > 6)
{
passu[a] = 'A' + rand() % 26;
}
cout << password[a];
}
return 0;
}
Wuaaah, i was bored and writed some tutorials here..
Code:
// program
#include <iostream.h>
#include <stdlib.h>
#include <time.h>
#include <string>
using std::cout; // make all absolutely right ;)
using std::cin;
using std::endl;
int main()
{
string password;
srand(time(0));
int num, a, b, c = 8; // c muuttujan arvo == how long password is
for(a = 0; a < c; a ++)
{
b = rand() % 10; // This generate what chrt is coming)
if(b < 3)
{
password[a] = '0' + rand() % 9;
}
if(b > 2 && b < 7)
{
passu[a] = 'a' + rand() % 26;
}
if(b > 6)
{
passu[a] = 'A' + rand() % 26;
}
cout << password[a];
}
return 0;
}
Wuaaah, i was bored and writed some tutorials here..