#include <stdio.h>
#include <string.h>
void generate_password(const char *mac, char *password) {
char cleaned[13];
int j = 0;
for (int i = 0; mac[i]; i++) {
if (mac[i] != ':') cleaned[j++] = toupper(mac[i]);
}
cleaned[j] = '\0';
unsigned long hash = 5381;
for (int i = 0; cleaned[i]; i++) {
hash = ((hash << 5) + hash) + cleaned[i];
}
char letters[5] = {0};
unsigned int temp = hash;
for (int i = 3; i >= 0; i--) {
letters[i] = 'a' + (temp % 26);
temp /= 26;
}
unsigned int digits = 0;
for (int i = 0; i < j; i++) {
digits = digits * 31 + cleaned[i];
}
digits %= 10000;
sprintf(password, "%.4s%04u", letters, digits);
}
int main() {
char mac[] = "";
char pwd[9];
generate_password(mac, pwd);
printf("Password: %s\n", pwd);
return 0;
}