If badchars analysis is accurate, I guess you should be able to use rand_text instead of rand_text_alpha here.