If you used a base64 representation of the hash instead of hexadecimal, it would only be 22 characters instead of 32. Still pretty long, though.
In your case, you only want the IDs to be unique, so you can just use an incrementing counter. (MD5's only benefit here¹ is that it produces IDs which aren't sequential, which you don't need.)
>>17
Birthday paradox.
❝The birthday problem in this more generic sense applies to hash functions: the expected number of N-bit hashes that can be generated before getting a collision is not 2N, but rather only 2N/2❞.
Yes, you expect a collision after 2
16 = 65536 items. Enjoy your collisions,
Patrick.
_____
¹ Probably. Too lazy to think of any others.