 
         for (algorithm, expectedPasswords) in expectedValues {
             let generator = Generator(factor: .timer(period: 30), secret: secret, algorithm: algorithm, digits: 6)
-            for i in 0..<times.count {
-                let expectedPassword = expectedPasswords[i]
-                let time = Date(timeIntervalSince1970: times[i])
+            for (timeSinceEpoch, expectedPassword) in zip(timesSinceEpoch, expectedPasswords) {
+                let time = Date(timeIntervalSince1970: timeSinceEpoch)
                 let password = generator.flatMap { try? $0.password(at: time) }
                 XCTAssertEqual(password, expectedPassword,
-                    "Incorrect result for \(algorithm) at \(times[i])")
+                    "Incorrect result for \(algorithm) at \(timeSinceEpoch)")
             }
         }
     }

            .sha512: "1234567890123456789012345678901234567890123456789012345678901234",
        ]

        let times: [TimeInterval] = [59, 1111111109, 1111111111, 1234567890, 2000000000, 20000000000]

        let expectedValues: [Generator.Algorithm: [String]] = [
            .sha1:   ["94287082", "07081804", "14050471", "89005924", "69279037", "65353130"],

    // https://code.google.com/p/google-authenticator/source/browse/mobile/ios/Classes/TOTPGeneratorTest.m
    func testTOTPGoogleValues() {
        let secret = "12345678901234567890".data(using: String.Encoding.ascii)!
        let timesSinceEpoch: [TimeInterval] = [1111111111, 1234567890, 2000000000]

        let expectedValues: [Generator.Algorithm: [String]] = [
            .sha1:   ["050471", "005924", "279037"],
