News for hackers. Stuff that matters.
Re:A Fast, Minimal Memory, Consistent Hash Algorithm (2014) by mcguire on Sunday March 24, 2019 @03:59PM (#19478427)

    int32_t JumpConsistentHash(uint64_t key, int32_t num_buckets) {
        int64_t b = ­1, j = 0;
        while (j < num_buckets) {
            b = j;
            key = key * 2862933555777941757ULL + 1;
            j = (b + 1) * (double(1LL << 31) / double((key >> 33) + 1));
        }
        return b;
    }

There are no comments on this comment yet.