The only thing I can see you gaining by using a hash of the ID is so that user 5 can't say "hm, I think I'll log on as user 6."
If you need to obscure logins, generate a session id each time they log in, and store the login credentials in the session table. You can also store a random number in the session table to prevent someone from hijacking someone else's session. (The random number really doesn't need to be bigger than 32 bits...) None of this requires any MD5 stuff. (BTW, MD5 is obsolete. Use SHA256 if possible.)