  As one of the three payloads of the Advanced Space-based Solar Observatory
(ASO-S), the pre-launch characterization of HXI includes the characterization
of the collimator and the spectrometer. This article focuses on the pre-launch
characterization of HXI's spectrometer, including detection efficiency, energy
resolution, and energy to ADC channel (E-C) relationship. The detection
efficiency characterization necessitates a sufficient number of calibrated
energy points in the HXI observation energy range, with a refined measurement
around the absorption edge of the lanthanum bromide crystal, and is calibrated
with an X-ray beam. The characterization results are consistent with the
simulations and show that the detection efficiency difference between detector
modules is controlled within $\pm3\%$. Radioactive sources $^{133}\textrm{Ba}$
and $^{137}\textrm{Cs}$ are used to calibrate the energy resolution and E-C
relationship. The characterization results show that all detector modules'
energy resolutions are better than $26\%$ at 32 keV, meeting the design
specification. And their E-C relationships vary regularly with voltage. All of
the characterization results indicate that the flight model of the HXI
spectrometer meets the performance requirements and is capable of performing
on-orbit observation activities.
