Review Request 1676: Improve random_string util function