Create a new user with the specified UID in Linux

For this - use --uid or -u option in useradd:

useradd --uid 31337 hacker