php password argon2i_PHP: 预定义常量 - Manual

PASSWORD_BCRYPT

(string)

PASSWORD_BCRYPT is used to create new password

hashes using the CRYPT_BLOWFISH algorithm.

This will always result in a hash using the "$2y$" crypt format,

which is always 60 characters wide.

Supported Options:

salt (string) - to manually provide a salt to use when hashing the password.

Note that this will override and prevent a salt from being automatically generated.

If omitted, a random salt will be generated by

cost (int) - which denotes the algorithmic cost that

should be used. Examples of these values can be found on the

If omitted, a default value of 10 will be used. This is a good

baseline cost, but you may want to consider increasing it depending on your hardware.

PASSWORD_ARGON2I

(string)

PASSWORD_ARGON2I is used to create new password

hashes using the Argon2i algorithm.

Supported Options:

memory_cost (int) - Maximum memory (in bytes) that may

be used to compute the Argon2 hash. Defaults to PASSWORD_ARGON2_DEFAULT_MEMORY_COST.

time_cost (int) - Maximum amount of time it may

take to compute the Argon2 hash. Defaults to PASSWORD_ARGON2_DEFAULT_TIME_COST.

threads (int) - Number of threads to use for computing

the Argon2 hash. Defaults to PASSWORD_ARGON2_DEFAULT_THREADS.

Available as of PHP 7.2.0.

PASSWORD_ARGON2ID

(string)

PASSWORD_ARGON2ID is used to create new password

hashes using the Argon2id algorithm. It supports the same options as

PASSWORD_ARGON2I.

Available as of PHP 7.3.0.

PASSWORD_ARGON2_DEFAULT_MEMORY_COST

(int)

Default amount of memory in bytes that Argon2lib will use while trying to

compute a hash.

Available as of PHP 7.2.0.

PASSWORD_ARGON2_DEFAULT_TIME_COST

(int)

Default amount of time that Argon2lib will spend trying to compute a hash.

Available as of PHP 7.2.0.

PASSWORD_ARGON2_DEFAULT_THREADS

(int)

Default number of threads that Argon2lib will use.

Available as of PHP 7.2.0.

PASSWORD_DEFAULT

(

The default algorithm to use for hashing if no algorithm is provided.

This may change in newer PHP releases when newer, stronger hashing

algorithms are supported.

It is worth noting that over time this constant can (and likely will)

change. Therefore you should be aware that the length of the resulting

hash can change. Therefore, if you use PASSWORD_DEFAULT

you should store the resulting hash in a way that can store more than 60

characters (255 is the recommended width).

Values for this constant:

PHP 5.5.0 - PASSWORD_BCRYPT

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值