PasswordService.php
1 <?php
2 /**
3  * wCMF - wemove Content Management Framework
4  * Copyright (C) 2005-2015 wemove digital solutions GmbH
5  *
6  * Licensed under the terms of the MIT License.
7  *
8  * See the LICENSE file distributed with this work for
9  * additional information.
10  */
12 
13 /**
14  * The PasswordService class provides services for password handling
15  *
16  * @author ingo herwig <ingo@wemove.com>
17  */
19 
20  /**
21  * Hash the given cleartext password
22  * @param $password
23  * @return String
24  */
25  public static function hash($password) {
26  return password_hash($password, PASSWORD_BCRYPT);
27 
28  }
29 
30  /**
31  * Check if the given hash represents the given password
32  * @param $password
33  * @param $passwordHash
34  * @return String
35  */
36  public static function verify($password, $passwordHash) {
37  return password_verify($password, $passwordHash);
38  }
39 }
static hash($password)
Hash the given cleartext password.
static verify($password, $passwordHash)
Check if the given hash represents the given password.
The PasswordService class provides services for password handling.