<commit_before>package com.carrotsearch.hppcrt.hash;

/**
 * Quickly mixes the bits of integers.
 * <p>Those methods mixes the bits of the argument by multiplying by the golden ratio and
 * xorshifting the result. It is borrowed from <a href="https://github.com/OpenHFT/Koloboke">Koloboke</a>, and
 * it has slightly worse behaviour than {@link MurmurHash3} (in open-addressing hash tables the average number of probes
 * is slightly larger), but it's much faster.
 */
public final class PhiMix
{
    /**
     *  2<sup>32</sup> &middot; &phi;, &phi; = (&#x221A;5 &minus; 1)/2.
     */
    private static final int INT_PHI = 0x9E3779B9;

    /**
     * 2<sup>64</sup> &middot; &phi;, &phi; = (&#x221A;5 &minus; 1)/2.
     */
    private static final long LONG_PHI = 0x9E3779B97F4A7C15L;

    /**
     * = hash(0)
     */
    public static final int HASH_0 = 0;

    /**
     * = hash(1)
     */
    public static final int HASH_1 = 1640556430;

    private PhiMix()
    {
        // no instances.
    }

    /**
     * Hashes a 4-byte sequence (Java int).
     * @param x an integer.
     * @return a hash value obtained by mixing the bits of {@code x}.
     */
    public final static int hash(final int x) {
        final int h = x * PhiMix.INT_PHI;
        return h ^ (h >> 16);
    }

    /**
     * Hashes an 8-byte sequence (Java long).
     * @param x a long integer.
     * @return a hash value obtained by mixing the bits of {@code x}.
     */
    public final static long hash(final long x) {
        long h = x * PhiMix.LONG_PHI;<commit_msg>Pedantic change in PhiMix<commit_after>package com.carrotsearch.hppcrt.hash;

/**
 * Quickly mixes the bits of integers.
 * <p>Those methods mixes the bits of the argument by multiplying by the golden ratio and
 * xorshifting the result. It is borrowed from <a href="https://github.com/OpenHFT/Koloboke">Koloboke</a>, and
 * it has slightly worse behaviour than {@link MurmurHash3} (in open-addressing hash tables the average number of probes
 * is slightly larger), but it's much faster.
 */
public final class PhiMix
{
    /**
     *  2<sup>32</sup> &middot; &phi;, &phi; = (&#x221A;5 &minus; 1)/2.
     */
    private static final int INT_PHI = 0x9E3779B9;

    /**
     * 2<sup>64</sup> &middot; &phi;, &phi; = (&#x221A;5 &minus; 1)/2.
     */
    private static final long LONG_PHI = 0x9E3779B97F4A7C15L;

    /**
     * = hash(0)
     */
    public static final int HASH_0 = 0;

    /**
     * = hash(1)
     */
    public static final int HASH_1 = 1640556430;

    private PhiMix()
    {
        // no instances.
    }

    /**
     * Hashes a 4-byte sequence (Java int).
     * @param x an integer.
     * @return a hash value obtained by mixing the bits of {@code x}.
     */
    public static int hash(final int x) {
        final int h = x * PhiMix.INT_PHI;
        return h ^ (h >> 16);
    }

    /**
     * Hashes an 8-byte sequence (Java long).
     * @param x a long integer.
     * @return a hash value obtained by mixing the bits of {@code x}.
     */
    public static long hash(final long x) {
        long h = x * PhiMix.LONG_PHI;
{'fraction_non_alphanumeric': 0.12508059316569956, 'fraction_numerical': 0.0367504835589942, 'mean_word_length': 2.35097192224622, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 21, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4230269', 'n_tokens_mistral': 1144, 'n_tokens_neox': 1049, 'n_words': 354}