generate rand string, encode in base64