I'm assuming this means that you know what the original word was, otherwise you obviously couldn't compare.. there are 2 ways to do it that i can think of, one being much better than the other of course

The first, and best way to do it, is to iterate through each character in the known word and try to find a match in the known word. Build a string as you match, and make sure there are no letters left, and each letter is only used once. Now of course that description makes no sense, so an example, using what you provided.
Known word - mirc
Random word - rmci
Match String -
emptySo we start with the first character of the known word, 'm'. Search through the random word until you find an 'm', which in this case will be the 2nd character.
Add this character to a new variable, and remove it from the random word. So now you've got:
Known Word - mirc
Random Word - rci
Match String - m
Now move to the 2nd character, 'i'. Search through the random word until you find an 'i', repeat above.
Known Word - mirc
Random Word - rc
Match String - mi
etc..
You'll end up with a few cases to check for to see if you've found a match:
1. There's a letter in the known word that isn't in the random word --> return false
2. You've iterated through the entire known word, and the random word still has character in it --> return false
3. The match string == known word, and random word = $null --> return true.
If you want I'll code it up, but it's a better learning experience if you do it yourself