"Fossies" - the Fresh Open Source Software Archive

Member "framework-8.65.0/src/Illuminate/Hashing/AbstractHasher.php" (19 Oct 2021, 710 Bytes) of package /linux/www/laravel-framework-8.65.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "AbstractHasher.php" see the Fossies "Dox" file reference documentation.

    1 <?php
    2 
    3 namespace Illuminate\Hashing;
    4 
    5 abstract class AbstractHasher
    6 {
    7     /**
    8      * Get information about the given hashed value.
    9      *
   10      * @param  string  $hashedValue
   11      * @return array
   12      */
   13     public function info($hashedValue)
   14     {
   15         return password_get_info($hashedValue);
   16     }
   17 
   18     /**
   19      * Check the given plain value against a hash.
   20      *
   21      * @param  string  $value
   22      * @param  string  $hashedValue
   23      * @param  array  $options
   24      * @return bool
   25      */
   26     public function check($value, $hashedValue, array $options = [])
   27     {
   28         if (strlen($hashedValue) === 0) {
   29             return false;
   30         }
   31 
   32         return password_verify($value, $hashedValue);
   33     }
   34 }