In order to be able to detect RT of a particular tweet, I plan to store hashes of each formatted tweet in the database.
What hashing algorithm should I use. Cryptic is of course not essential. Just a minimal way of storing a data as something which can then be compared if it is the same, in an efficient way.
My first attempt at this was by using md5 hashes. But I figured there can be hashing algorithms that are much more efficient, as security is not required.
There are a few issues here.  First, RT's are not always identical.  Some people add a comment.  Others change the URL for tracking.  Others add in the person that they are RT'ing (which may or may not be the originator).
So if you are going to hash the tweet, you need to boil it down to the meat of the tweet, and only hash that.  Good luck.
Above, someone mentioned that with 32-bits, you will start having collisions at about 65K tweets.  Of course, you could have collisions on tweet #2.  But I think the author of that comment was confused, since 2^16 = ~65K, but 2^32 = ~4 Trillion.   So you have a little more room there.
A better algorithm might be to try to derive the "unique" parts of the tweet,  and fingerprint it.  It's not a hash, it's a fingerprint of a few key words that define uniqueness.
Detecting Retweets using computationally inexpensive Python hashing algorithms