A device and method of collision-free hashing of near-match inputs that includes the following components. An adder for receiving an input i, a check value cv, and outputs n, which is greater than or equal to the sum of i and cv. A checker for receiving a value n, a value d, a first polynomial, and an output at which the first polynomial appears if the checker determines that the first polynomial is of degree proportional to d and divides xn+1. A factorization block for factoring the first polynomial into a second polynomial and a third polynomial. A first division block for dividing an input of bit length i by the second polynomial to generate a first portion of the hash of the input. A second division block for dividing the input by the third polynomial to generate a second portion of the hash of the input.