<?php
//Required shit
/*define('IN_PHPBB', true);
$phpbb_root_path = $_SERVER['DOCUMENT_ROOT'] . '/forum/';

$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.php')
include($phpbb_root_path . 'includes/functions_user.php');
include($phpbb_root_path . 'includes/ucp/ucp_register.php');
*/
include('PasswordHash.php');

$pass = new PasswordHash(false,true);
//Functions
function phpbb_date($timestamp,$format = "m d Y"){
	return date($format, $timestamp);
}
function phpbb_check_pass($password,$hash,$pass)
{
 
	$check = $pass->CheckPassword($password, $hash);
	if($check){
		return true;
	}else{
		return false;
	}
}
function phpbb_generate_pass($password,$pass)
{
	$hash = $pass->HashPassword($password);
	if($hash){
		return $hash;
	}else{
		return false;
	}
}
function generateString($length = 8){
	$password = "";
	$possible = "0123456789bcdfghjkmnpqrstvwxyz";
	$i = 0;

	// add random characters to $password until $length is reached
	while ($i < $length) {
	    // pick a random character from the possible ones
    	$char = substr($possible, mt_rand(0, strlen($possible)-1), 1);

	    // we don't want this character if it's already in the password
	    if (!strstr($password, $char)) {
    	  $password .= $char;
	      $i++;
	    }
  }
  // done!
  return $password;
}
?>