Helper method for generating alphanumeric password