private TreeMap<Long, String> buildConsumerMap(final List<String> curConsumers) {
        final TreeMap<Long/* hash */, String/* consumerId */> consumerMap = new TreeMap<Long, String>();
        for (final String consumer : curConsumers) {
            if (this.alg == HashAlgorithm.KETAMA_HASH) {
                for (int i = 0; i < NUM_REPS / 4; i++) {
                    final byte[] digest = HashAlgorithm.computeMd5(consumer + "-" + i);
                    for (int h = 0; h < 4; h++) {
                        final long k =
                                (long) (digest[3 + h * 4] & 0xFF) << 24 | (long) (digest[2 + h * 4] & 0xFF) << 16
                                        | (long) (digest[1 + h * 4] & 0xFF) << 8 | digest[h * 4] & 0xFF;
                        consumerMap.put(k, consumer);
                    }

                }
            }
            else {
                for (int i = 0; i < NUM_REPS; i++) {
                    final long key = this.alg.hash(consumer + "-" + i);
                    consumerMap.put(key, consumer);
                }
            }

        }
        return consumerMap;
    }
Get the md5 of the given key.
metamorphosis-client/src/main/java/com/taobao/metamorphosis/client/consumer/ConsisHashStrategy.java