This should help out

Rand_string was used in a recent commit - I thought it was core (my bad) but pretty sure I got the original function from 1.x so.. Adding it back in. It's a nice little bit o code.