I'm having trouble researching this one for ideas, just the right terms are eluding me. Say I have a hexadecimal string that is always unique (http://php.net/manual/en/class.mongoid.php). I need to find a way to "shard" or split these keys across N groups. Doesnt really matter how many groups, preferably 16 or 32 groups I suppose. But I need to ensure that they get evenly split, and none are overlooked.

So the term is called a "shard key" within MongoDB, but I need to recreate my own within my own programming language (php or python). Any ideas or terms that I can use to get researching / testing?

If it helps at all my end goal is to be able to multi thread a task on data sets.