Randomness extraction and asymptotic Hamming distance (Logical Methods in Computer Science, 2013)