optimized verifyCode

there is no need for calculating all codes