diff options
author | Remi Collet <remi@remirepo.net> | 2024-09-13 15:47:49 +0200 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2024-09-13 15:47:49 +0200 |
commit | 0fa41045544761a863e44ee88c962bd78fd99eab (patch) | |
tree | 0870cae8a42c6f0ac5860d6080fb7ceabaaa945c | |
parent | 6c7eb261b7537e429719dd59b392c0421eaa5ce2 (diff) |
doc for crypt helpers
-rw-r--r-- | README.md | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -67,6 +67,25 @@ From the sources tree * `cost` controls the CPU time cost of the hash. If `cost` is 0, a reasonable default cost will be selected. +## crypt helpers + + $ php -a + + php > var_dump(crypt_preferred_method()); + string(3) "$y$" + + php > var_dump($salt = crypt_gensalt()); + string(29) "$y$j9T$EitfN8MxRjFzV5tNe97D70" + + php > var_dump(crypt_checksalt($salt) == CRYPT_SALT_OK); + bool(true) + + php > var_dump($hash = crypt("secret", $salt)); + string(73) "$y$j9T$EitfN8MxRjFzV5tNe97D70$vGtxczdGMTLh0LfpwxAmyzgba7EODsmazEh03kpvbh3" + + php > var_dump($hash === crypt("secret", $hash)); + bool(true) + # LICENSE Author: Remi Collet |