A method of constructing a quantum hash function (QHF) based on continuous-time quantum walk is proposed, in which the time of quantum walk is controlled by the binary string message, namely, a binary string message as the input of the constructed QHF and the probability value of finally walking to the nodes on the cycle is used as the output of the QHF. Numerical simulation and performance analysis show that our QHF has obvious advantages in the efficiency of the QHF compared with the existing QHF based on the discrete-time quantum walk, that is, the efficiency of our scheme is nearly 4 times faster in computing the hash value of the same size file compared with the most efficient scheme. Besides, the QHF has also better collision resistance compared with the existing QHF based on the discrete-time quantum walk.