diff options
Diffstat (limited to 'src/Wallabag/GroupBundle/Service')
-rw-r--r-- | src/Wallabag/GroupBundle/Service/Sha256Salted.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/Wallabag/GroupBundle/Service/Sha256Salted.php b/src/Wallabag/GroupBundle/Service/Sha256Salted.php new file mode 100644 index 00000000..c72486ad --- /dev/null +++ b/src/Wallabag/GroupBundle/Service/Sha256Salted.php | |||
@@ -0,0 +1,18 @@ | |||
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 | } | ||