def jump_consistent_hash(key, num_buckets) b = -1 j = 0 while j < num_buckets b = j key = (key * 2862933555777941757 + 1) % (2 ** 64) j = ((b + 1) * (2 ** 31) / ((key >> 33) + 1)) % (2 ** 31) end b end