  Constacyclic and quasi-twisted Hermitian self-dual codes over finite fields
are studied. An algorithm for factorizing $x^n-\lambda$ over $\mathbb{F}_{q^2}$
is given, where $\lambda$ is a unit in $\mathbb{F}_{q^2}$. Based on this
factorization, the dimensions of the Hermitian hulls of $\lambda$-constacyclic
codes of length $n$ over $\mathbb{F}_{q^2}$ are determined. The
characterization and enumeration of constacyclic Hermitian self-dual (resp.,
complementary dual) codes of length $n$ over $\mathbb{F}_{q^2}$ are given
through their Hermitian hulls. Subsequently, a new family of MDS constacyclic
Hermitian self-dual codes over $\mathbb{F}_{q^2}$ is introduced.
  As a generalization of constacyclic codes, quasi-twisted Hermitian self-dual
codes are studied. Using the factorization of $x^n-\lambda$ and the Chinese
Remainder Theorem, quasi-twisted codes can be viewed as a product of linear
codes of shorter length some over extension fields of $\mathbb{F}_{q^2}$.
Necessary and sufficient conditions for quasi-twisted codes to be Hermitian
self-dual are given. The enumeration of such self-dual codes is determined as
well.
