Cryptanalysts now can effectively find the collisions of MD5, SHA1 and other international hash algorithms in a short time. Increasing entropy to enhance the randomness of hash value is an effective way to improve the anti-collision performance of hash algorithm. Therefore, an improved scheme combining the iterative structure of error-correcting code and SM3 algorithm was proposed. Firstly, based on the linear properties of error-correcting codes and the maximization principle of minimum Hamming distance, the binary linear block codes constructed by matroid theory were selected to calculate their systematic form of generation matrix, the rules between bits were eliminated by cyclic shift, and the effective code words were calculated. Secondly, in the linear block code, an optimal code word was selected to construct the initial constant value according to the periodicity principle, and its value was assigned to the initial register. At the same time, a compression function of the initial register formation algorithm was introduced into the iterative structure to complete the second construction of the iterative structure of the hash algorithm. Finally, considering the evaluation ability of hash value information entropy on chaos degree of the algorithm, the proposed scheme was compared with existing international hash algorithms, and avalanche effect, the algorithm efficiency and memory loss were tested and comprehensively evaluated. Experimental results showed that the proposed scheme has stable avalanche effects without changing the computational efficiency, the memory loss during operation is 0.01~0.07 MB lower than that of SM3 algorithm, and the information entropy of the hash value is higher than that of other comparison algorithms. The improved scheme based on error correction code can prove that the randomness between hash bits is higher through entropy increase, which can better achieve the purpose of hiding statistical information between plaintext and hash, value, and improve the security of hash algorithm.