Hashes 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.
This function is also offered as long running task with the HashTask function, which is meant for if you have the need for very high work rate without having the hardware to do that in short time.
This function can raise InvalidArgumentException exception.