DNA to Binary Distance Computation
The best way is to choose a distance that represents what you want it to rather than necessarily relying on the Hamming distance.

If you simply want base-by-base difference then calculate that (this may help) but you may also want a difference that depends on the likelyhood of mutating between different bases in which case you want to define a function that translates the mutation into a score for each transfer, i.e. you might want to score a deamination from 5-methylcytosine to thymine as the most likely occurrence. Expressing the relative likelyhoods of different mutations is not an easy problem but there are a number of widely used options.

The important thing is to ensure you represent the underlying biology not ensure that you have the fastest implementation. Decide on this first, then on the algorithm that gives you the best speed (also, deciding on that algorithm is on-topic for Stack Overflow not this Stack Exchange).