AbstractHasher.php 709B

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