#include <iostream>
#include <cstdlib>
#include <ctime>
using namespace std;
string generatePassword(int minLen, int maxLen) {
const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
int length = minLen + (rand() % (maxLen - minLen + 1)); // طول عشوائي بين minLen و maxLen
string password = "";
for (int i = 0; i < length; i++) {
password += chars[rand() % chars.size()];
}
return password;
}
int main() {
srand(time(0)); // تهيئة مولد الأرقام العشوائية
const int minLength = 12;
const int maxLength = 16;
while (true) {
string pass = generatePassword(minLength, maxLength);
cout << pass << endl;
}
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: