aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/GroupBundle/Service/Sha256Salted.php
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2017-01-31 21:13:33 +0100
committerThomas Citharel <tcit@tcit.fr>2017-06-23 09:26:41 +0200
commit2041810adbc6e663e4520337805c0003c77762e2 (patch)
tree1715a1e57a0275efe0970807c65f424def897034 /src/Wallabag/GroupBundle/Service/Sha256Salted.php
parentb115623e2c536bcfd59760347f22b4d70e1d0661 (diff)
downloadwallabag-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.php18
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
3namespace Strut\StrutBundle\Service;
4
5use Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface;
6
7class 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}