multi site subdomain same as user name

hello

I am starting new projects and i only want to let user to get subdomain as his/her user name how i can do that ?
when new registration made by defulte they get subdomin as user nickname

Thank you