There are hashes that will hash into any number of "buckets". Since you do not care about security or "accuracy", what I have done in the past is just to use the first or last characters of the MD5 hash. It has always been random enough for me. There is a danger of collision, but that is true of a smaller hash function, too.
It looks as though you need about 32 bits of hash (5 or 6 bits/char depending on char set and 5 or 6 chars). How about Digest::Adler32 or CRC32?
--traveler