简体   繁体   English

Hash :: make函数是否总是在Laravel中返回60个字符?

[英]Is Hash::make function always return 60 characters in Laravel?

I installed a fresh version of laravel 4.2, I am making a user table and I want to ask if the Hash::make function always return 60 characters so that I can make the password field data type CHAR(60). 我安装了新版本的laravel 4.2,正在创建用户表,我想问一下Hash :: make函数是否始终返回60个字符,以便可以将密码字段数据类型设置为CHAR(60)。

Additional: I'm using the default configurations of laravel. 另外:我使用的是laravel的默认配置。

Judging from the implementation : 执行情况来看:

$hash = password_hash($value, PASSWORD_BCRYPT, array('cost' => $cost));

It uses password_hash() and according to the manual: 它使用password_hash()并根据手册:

Use the CRYPT_BLOWFISH algorithm to create the hash. 使用CRYPT_BLOWFISH算法创建哈希。 This will produce a standard crypt() compatible hash using the "$2y$" identifier. 这将使用“ $ 2y $”标识符生成标准的crypt()兼容哈希。 The result will always be a 60 character string , or FALSE on failure. 结果将始终为60字符串 ,如果失败则为FALSE。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM