Universal hash function for strings of unbounded length
Any such hash function must have an infinite key.
Suppose that your hash function maps binary strings to some alphabet $\Sigma$ of size $m &gt; 1$. We can identify binary strings with natural numbers, and so can think of the hash function as a function $h\colon K \times \mathbb{N} \to \Sigma$, where $K$ is the (finite) set of keys.
For each $n \in \mathbb{N}$, we can look at the function $h_n\colon K \to \Sigma$ given by $h_n(k) = h(k,n)$. There are finitely many possible functions $h_n$ (at most $m^{|K|}$), and so there must exist $n_1 &lt; n_2$ such that $h_{n_1} = h_{n_2}$. In particular, $\Pr_k[h(k,n_1) = h(k,n_2)] = 1$, and so $h$ is not even a weakly universal function.