equal
deleted
inserted
replaced
66 * |
66 * |
67 * @param string $token Session token to hash. |
67 * @param string $token Session token to hash. |
68 * @return string A hash of the session token (a verifier). |
68 * @return string A hash of the session token (a verifier). |
69 */ |
69 */ |
70 private function hash_token( $token ) { |
70 private function hash_token( $token ) { |
71 // If ext/hash is not present, use sha1() instead. |
71 return hash( 'sha256', $token ); |
72 if ( function_exists( 'hash' ) ) { |
|
73 return hash( 'sha256', $token ); |
|
74 } else { |
|
75 return sha1( $token ); |
|
76 } |
|
77 } |
72 } |
78 |
73 |
79 /** |
74 /** |
80 * Retrieves a user's session for the given token. |
75 * Retrieves a user's session for the given token. |
81 * |
76 * |