From what I understand, the reference must be a maximum of 8 characters long. But does it have to be this length? If so, you'll need to take into account that you'll need to add one or more predefined characters to fill in if the item passed as a parameter is smaller than the minimum size.
Secondly, to answer your question, the human brain can recognize a word, especially by its first and last letters, and the content in the middle more or less resembles the complete word. For example, reading 'acheivement' when there's an error is relatively easy. It's also worth noting that the human brain is very good at reading without vowels, which it can reconstruct fairly well. If we take the word 'table' for example, it's quite easy to read with 'TBL'.
So, in terms of algorithm, I think it might be interesting to keep the first and last vowels of the word. Delete vowels (word by word), as long as the string is not smaller than the maximum size. If there are strictly more than 4 words in the input, you'll need to define a different algorithm (keep only the first of each word?). The same question arises if there are more than 8 words in the input (keep only the first letter of the first words?).
I'm sure we'll need more details on what you really want from your coding system. Once all this is defined, an algorithm will emerge naturally from your requirements.