I am still new on laravel, and just use laravel package name Crypt
but I found some that there are
Crypt::encrypt
and
Crypt::encryptString
what is the difference between them?
I am still new on laravel, and just use laravel package name Crypt
but I found some that there are
Crypt::encrypt
and
Crypt::encryptString
what is the difference between them?
You can always refer to source code to know.
See Line 122 of Encrypter.php:
return $this->encrypt($value, false);
Behind the scenes the encryptString
calls the encrypt()
method with false
as second parameter, meaning that it won't serialize the value you give.
There's no difference in the behavior, but it will encrypt faster and the result will be slightly smaller because it won't contain string serialization.