diff options
author | Thomas Citharel <tcit@tcit.fr> | 2017-01-31 21:13:33 +0100 |
---|---|---|
committer | Thomas Citharel <tcit@tcit.fr> | 2017-06-23 09:26:41 +0200 |
commit | 2041810adbc6e663e4520337805c0003c77762e2 (patch) | |
tree | 1715a1e57a0275efe0970807c65f424def897034 /src/Wallabag/GroupBundle/Service/Sha256Salted.php | |
parent | b115623e2c536bcfd59760347f22b4d70e1d0661 (diff) | |
download | wallabag-2041810adbc6e663e4520337805c0003c77762e2.tar.gz wallabag-2041810adbc6e663e4520337805c0003c77762e2.tar.zst wallabag-2041810adbc6e663e4520337805c0003c77762e2.zip |
WIP
Diffstat (limited to 'src/Wallabag/GroupBundle/Service/Sha256Salted.php')
-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 | } | ||