ensure random generator always generates the desired length of strings