Server IP : 172.67.216.182 / Your IP : 104.23.175.202 Web Server : Apache System : Linux krdc-ubuntu-s-2vcpu-4gb-amd-blr1-01.localdomain 5.15.0-142-generic #152-Ubuntu SMP Mon May 19 10:54:31 UTC 2025 x86_64 User : www ( 1000) PHP Version : 7.4.33 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /www/wwwroot/lapma.in/phpMyAdmin/vendor/thecodingmachine/safe/generated/ |
Upload File : |
<?php namespace Safe; use Safe\Exceptions\PasswordException; /** * password_hash creates a new password hash using a strong one-way hashing * algorithm. password_hash is compatible with crypt. * Therefore, password hashes created by crypt can be used with * password_hash. * * * * * PASSWORD_DEFAULT - Use the bcrypt algorithm (default as of PHP 5.5.0). * Note that this constant is designed to change over time as new and stronger algorithms are added * to PHP. For that reason, the length of the result from using this identifier can change over * time. Therefore, it is recommended to store the result in a database column that can expand * beyond 60 characters (255 characters would be a good choice). * * * * * PASSWORD_BCRYPT - Use the CRYPT_BLOWFISH algorithm to * create the hash. This will produce a standard crypt compatible hash using * the "$2y$" identifier. The result will always be a 60 character string. * * * * * PASSWORD_ARGON2I - Use the Argon2i hashing algorithm to create the hash. * This algorithm is only available if PHP has been compiled with Argon2 support. * * * * * PASSWORD_ARGON2ID - Use the Argon2id hashing algorithm to create the hash. * This algorithm is only available if PHP has been compiled with Argon2 support. * * * * * * * * 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 password_hash for * each password hashed. This is the intended mode of operation. * * * * The salt option has been deprecated as of PHP 7.0.0. It is now * preferred to simply use the salt that is generated by default. * * * * * * cost (integer) - which denotes the algorithmic cost that should be used. * Examples of these values can be found on the crypt page. * * * 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. * * * * * * * * memory_cost (integer) - Maximum memory (in kibibytes) that may * be used to compute the Argon2 hash. Defaults to PASSWORD_ARGON2_DEFAULT_MEMORY_COST. * * * * * time_cost (integer) - Maximum amount of time it may * take to compute the Argon2 hash. Defaults to PASSWORD_ARGON2_DEFAULT_TIME_COST. * * * * * threads (integer) - Number of threads to use for computing * the Argon2 hash. Defaults to PASSWORD_ARGON2_DEFAULT_THREADS. * * * * * @param string $password The user's password. * * Using the PASSWORD_BCRYPT as the * algorithm, will result * in the password parameter being truncated to a * maximum length of 72 characters. * @param int|string|null $algo A password algorithm constant denoting the algorithm to use when hashing the password. * @param array $options An associative array containing options. See the password algorithm constants for documentation on the supported options for each algorithm. * * If omitted, a random salt will be created and the default cost will be * used. * @return string Returns the hashed password. * * The used algorithm, cost and salt are returned as part of the hash. Therefore, * all information that's needed to verify the hash is included in it. This allows * the password_verify function to verify the hash without * needing separate storage for the salt or algorithm information. * @throws PasswordException * */ function password_hash(string $password, $algo, array $options = null): string { error_clear_last(); if ($options !== null) { $result = \password_hash($password, $algo, $options); } else { $result = \password_hash($password, $algo); } if ($result === false) { throw PasswordException::createFromPhpError(); } return $result; }