We propose an algorithm combining distributed recursive Gaussian process (drGP) regression with Message-Digest Algorithm 5 (MD5) Hash algorithm for indoor positioning (MD5-drGP), aiming to increase the rate of positioning process. The proposed algorithm processes the reference points database of positioning based on drGP by MD5, making the length of probability fingerprints becomes shorter and improving the matching rate of positioning. It realizes the optimization of the database. The simulation results show that the MD5-drGP algorithm greatly reduces the positioning time comparing to the conventional standard gaussian process and drGP, so that it develops the positioning efficiency. Meanwhile, the positioning accuracy is not affected.