There are already several such tools to generate unique username. Some of them are:
1 Jimpix
2 Best Username Generator
3 Speedy Password
4 SpinXO
5 Screen Name Generator
6 Rum & Monkey
Source: - https://www.techwhoop.com/random-username-generator/
Hope it helps you.