php password_hash 中的最大允许成本是多少?

cma*_*mac 2 php encryption bcrypt

PHP password_hash()函数的最大允许成本是多少?

    $options = [
      'cost' => 18,
    ];
    $res = password_hash("donkey", PASSWORD_BCRYPT, $options);
    var_dump($res);
Run Code Online (Sandbox Code Playgroud)

到目前为止,我尝试过这些成本,时间正在迅速攀升。

  • 15 花了大约 1.623... 秒
  • 18 花了大约 12.756... 秒
  • 19 花了大约 25.149... 秒
  • 20 花了大约 51.215... 秒

我尝试了 120 并得到:

指定的 bcrypt 成本参数无效

所以我知道有一个限制,但我没有在 PHP 文档中看到它。有人知道这是什么吗?