code: public static function hash($password)
      {
          return \Yii::$app->security->generatePasswordHash($password, \Yii::$app->getModule('user')->cost);
      }
docs: Wrapper for yii security helper method.
  
  @param $password
  @return string