]> git.immae.eu Git - github/wallabag/wallabag.git/blob - src/Wallabag/GroupBundle/Service/Sha256Salted.php
WIP
[github/wallabag/wallabag.git] / src / Wallabag / GroupBundle / Service / Sha256Salted.php
1 <?php
2
3 namespace Strut\StrutBundle\Service;
4
5 use Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface;
6
7 class Sha256Salted implements PasswordEncoderInterface
8 {
9 public function encodePassword($raw, $salt)
10 {
11 return hash('sha256', $salt . $raw); // Custom function for password encrypt
12 }
13
14 public function isPasswordValid($encoded, $raw, $salt)
15 {
16 return $encoded === $this->encodePassword($raw, $salt);
17 }
18 }