All perfect praise be to Allah, The Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad, sallallahu ‘alayhi wa sallam, is His slave and Messenger.
You do not have to repeat the prayer because of what you mentioned, and your prayer is valid, Allah willing. Scholars stated that swallowing an insignificant amount of food - such as the remains of food between the teeth - during the prayer does not invalidate the prayer, even if it is done deliberately. The ruling applies with greater reason to any substance that is not food, like the hair which you might have swallowed non-deliberately and that might also have remained inside your mouth and not have been swallowed.
Az-Zarqaani said about the statement, "Deliberately swallowing what is between his teeth" in his commentary on Mukhtasar Khaleel Al-Maaliki, "The statement of (Imaam Maalik) in Al-Mudawwanah reads, 'If there is food the size of half a grain between one's teeth and he swallowed it during the prayer, then that does not invalidate the prayer.'” [Sharh Mukhtasar Kahleel Al-Maaliki]
The Hanbali scholar Ibn An-Najjaar while addressing the matters that do not invalidate the prayer, wrote, "Swallowing food or drink whose amount is considered insignificant, regardless of whether that happens due to forgetfulness or ignorance of the relevant ruling. The same ruling applies to swallowing what is between the teeth without chewing it, even if it did not flow with the swallowed saliva..." [Muntaha Al-Iradaat]
Hence, based on the assumption that you actually swallowed that hair, even if deliberately, your prayer is valid, and this does not count as eating during the prayer.
Allah knows best.