Creates task object to hash the token / password, taking in number of rounds (cost), so that salt can be generated internally on the fly.
This cost is also known as the work factor. It is recommended as a common rule of thumb for work factor setting to tune the cost so that the function runs as slow as possible without affecting the users experience and without increasing the need to use additional hardware that may be over budget.
The task version of the function is for if you have to deal with cost rates that are not really fitting for your hardware. Then it can be good to set up such long running task.
This function can raise InvalidArgumentException exception.