keyspace

How to algorithmically partion a keyspace?

This is related to consistent hashing and while I conceptually understand what I need to do, I'm having a hard time translating this into code. I'm trying to divide a given keyspace (say, 128 bits) into equal sized partitions. I want the upper bound (highest key) of each partition. Basically, how would I complete this? #define KEYSPAC...