Sort of worked this out today, it's pretty cool but I can't think of any use for it!
Fastest algorithm to find out if one word is a scrambled version of the other. (Same # chars).
If u map each character in the alphabet to a unique prime number:
a=2, b=3, c=5 etc etc
then you get a word like:
"Scirra"
Multiply all the primes together that form that word.
Doesnt matter what order they are in, you get the same result every time, no loops needed! No other word will generate that final number. (That's a cool feature of prime numbers, hence why they are used in cryptography so often).
This is probably theoretical because length of word + alphabet size make the maximum integer size too large to handle.