Advertisement
Guest User

Astrups/SpectacleBundle/Service/Sha1Salted.php

a guest
Apr 19th, 2013
570
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.42 KB | None | 0 0
  1. <?php
  2.  
  3. namespace Astrups\SpectacleBundle\Service;
  4.  
  5. use Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface;
  6.  
  7. class Sha1Salted implements PasswordEncoderInterface
  8. {
  9.     public function encodePassword($raw, $salt)
  10.     {
  11.         return sha1($raw . $salt);
  12.     }
  13.  
  14.     public function isPasswordValid($encoded, $raw, $salt)
  15.     {
  16.         return $encoded === $this->encodePassword($raw, $salt);
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement