Function to create a random string