src/login_password.php
public static function hash_password($password) {
	$exception = bootstrap::get_library('exception');
	
	if (mb_strlen($password) < self::MINIMUM_LENGTH) {
		throw new $exception('passwords need a minimum length of '.self::MINIMUM_LENGTH);
	}
	
	$hash = password_hash($password, PASSWORD_DEFAULT);
	if (empty($hash)) {
		throw new $exception('unable to hash password');
	}
	
	return $hash;
}
public static function hash_password($password) {
	$exception = bootstrap::get_library('exception');
	
	if (mb_strlen($password) < self::MINIMUM_LENGTH) {
		throw new $exception('passwords need a minimum length of '.self::MINIMUM_LENGTH);
	}
	
	$hash = password_hash($password, PASSWORD_DEFAULT);
	if (empty($hash)) {
		throw new $exception('unable to hash password');
	}
	
	return $hash;
}
public static function hash_password ( $ password ) { $ exception = bootstrap :: get_library ( 'exception' ) ; if ( mb_strlen ( $ password ) < self :: MINIMUM_LENGTH ) { throw new $ exception ( 'passwords need a minimum length of ' . self :: MINIMUM_LENGTH ) ; } $ hash = password_hash ( $ password , PASSWORD_DEFAULT ) ; if ( empty ( $ hash ) ) { throw new $ exception ( 'unable to hash password' ) ; } return $ hash ; }
generates a new hash for the given password
we wrap the native method to ensure a successful hash

also enforces a minimum length for passwords
@see ::MINIMUM_LENGTH

@param  string $password
@return string
generates a new hash for the given password we wrap the native method to ensure a successful hash