Nthash on CuriousCodinghttps://curiouscoding.nl/tags/nthash/Recent content in Nthash on CuriousCodingHugo -- gohugo.ioenSun, 31 Dec 2023 00:00:00 +0100Perfect NtHash for Robust Minimizershttps://curiouscoding.nl/posts/nthash/Sun, 31 Dec 2023 00:00:00 +0100https://curiouscoding.nl/posts/nthash/Table of Contents NtHash Minimizers Robust minimizers Is NtHash injective on kmers? Searching for a collision Proving perfection Alternatives SmHasher results TODO benchmark NtHash, NtHash2, FxHash NtHash NtHash (Mohamadi et al. 2016) is a rolling hash suitable for hashing any kind of text, but made for DNA originally. For a string of length \(k\) it is a \(64\) bit value computed as:
\begin{equation} h(x) = \bigoplus_{i=0}^{k-1} rot^i(h(x_i)) \end{equation}
where \(h(x_i)\) assigns a fixed \(64\) bit random value to each character, \(rot^i\) rotates the bits \(i\) places, and \(\bigoplus\) is the xor over all terms.