One way is to create a hash from one (or more) customer properties. A hash is a function that creates a string from a source string. The same source string will allways generate the same hash.
But you have to take care of two problems with hashs: you can't generate the source string from the hash (because the hashing algorithm is non reversible) and you have to take care of possible hash collisions (two differents strings generating the same hash). It is quite unlikely given your hash has enough length (md5 has 32 characters, sha1 is 40 long...).
If you need a two way encryption (getting a string from the username, then generating back that username from the string), then you'll need to look at encryption techniques.
Have a look at the mcrypt library that provide many differents encryption/hashing algorithms. I'm sure you'll find one that suit your needs.