Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <vector>
- #include <cmath>
- #include "md5.h"
- using namespace std;
- vector<string> randpgen(vector<string> &a, vector<string> &b) {
- char alphabet[26] = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
- vector<string>::iterator iterb = b.begin();
- for (auto itera = a.begin(); itera < a.end(); ++itera) {
- for (int i = 0; i < 26; i++) {
- *iterb = *itera + alphabet[i];
- ++iterb;
- }
- }
- return b;
- }
- int main() {
- vector<string> randp1{"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};
- vector<string> randp2(pow(26, 2)), randp3(pow(26, 3)), randp4(pow(26, 4)), randp5(pow(26, 5)), randp6(pow(26, 6));
- randp2 = randpgen(randp1, randp2);
- randp3 = randpgen(randp2, randp3);
- randp4 = randpgen(randp3, randp4);
- randp5 = randpgen(randp4, randp5);
- //randp6 = randpgen(randp5, randp6);
- for (auto j = randp5.begin(); j != randp5.end(); ++j) {
- cout << *j << ' ';
- }
- cout << endl;
- cout << "Size 5 character passwords: " << randp5.size() << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement