Replace call to deprecated String.substring method
Replace call to deprecated String.substring method

Also refactor makeRandomString function and improve its performance

envoy/Embassy,envoy/Embassy,envoy/Embassy