Hi guys,

I'm trying to create a hash algorithm (a very simple one) for homework exercise.

I basically have taken an input from the user and hash it using:

a = 1, b =2, c = 3 ... z = 26.

So if the user input is abc, it will store 123.

My functions for creating a username and password so far:
Code:
// registering an account

void regAccount(){	cout << "Please enter your username: ";	cin >> inputUsername; cout << endl;	if (inputUsername == username[0] || inputUsername == username[1] || inputUsername == username[2] || inputUsername == username[3] || inputUsername == username[4] ||		inputUsername == username[5] || inputUsername == username[6] || inputUsername == username[7] || inputUsername == username[8] || inputUsername == username[9])	{		cout << "Username already exists" << endl;	}	else	{		for (i = 0; i < 10; i++)		{			if (username[i] == "Empty")			{				username[i] = inputUsername;				hashPass();				cout << "Is this account an admin?    -    1 = yes / 2 = no: ";				cin >> input;				if (input == 1)				{					admin[i] = true;				}				else				{					admin[i] = false;				}				break;			}		}	}	}// hash the passwordvoid hashPass(){	cout << "Please enter your password: ";	cin >> password[i]; cout << endl;	for (int j = 0; j < password[j].length(); j++)	{		// possibly a switch statement checking if password[i] == a, b, c...	} }

Thanks for having a look.