Login string distance alg