summaryrefslogtreecommitdiff
path: root/src/lib/Hasher.class.php
blob: dc16d688cb2b60302ccf82444777e1b7894d40fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php
require_once('Singleton.class.php');
require_once('PasswordHash.class.php');

class Hasher extends Singleton {
	private $pw_hash;
	
	function __construct() {
		$this->pw_hash = new PasswordHash(8, false);
	}
	
	public function hash($password) {
		return $this->pw_hash->HashPassword($password);
	}
	public function check($password, $hash) {
		return $this->pw_hash->CheckPassword($password, $hash);
	}
}