package ru.yandex.webmaster3.core.util;

/**
 * Created by Oleg Bazdyrev on 25/01/2021.
 * см. https://a.yandex-team.ru/arc/trunk/arcadia/util/digest/numeric.h
 */
public class NumericHash {

    public static long intHash64(long key) {
        key += ~(key << 32);
        key ^= (key >>> 22);
        key += ~(key << 13);
        key ^= (key >>> 8);
        key += (key << 3);
        key ^= (key >>> 15);
        key += ~(key << 27);
        key ^= (key >>> 31);
        return key;
    }

    public static long combineHashes(long a, long b) {
        return intHash64(a) ^ b;
    }

}
