Reset Typecho Password

<?php
include_once('config.inc.php');

Typecho_Widget::widget('Widget_Init');

$password = 'new password';
$password_hashed = (new PasswordHash(8, true))->HashPassword($password);

$db = Typecho_Db::get();
$db->query(
  $db->update('table.users')
    ->rows(['password' => $password_hashed])
    ->where('uid = ?', 1)
);

header('Content-Type: text/plain');
echo('typecho reset password done');