I am going to use email as a username across the website, however I still need to pre-fill the mandatory username field in User model somehow.
Initially I was thinking of using a md5 hash of the email as username, but given the limitation of 30 characters it is not possible. Also I don’t think I can use GUIDs for that as they are also longer than 30 chars when converted to string hex.
Any suggestions greatly appreciated!
I wouldn’t stress too much about GUIDs being longer than 30 characters. A reasonable approach is probably to hash the GUID using something like MD5, and then trim off the last 2 characters. Your chances of a collision are effectively nil. (1630 is an awfully large number).