Commit 0d2f985bb2c805b8a53e447b3e8b5f78d5563047

muji 2023-09-07T12:41:23

Tidy unnecessary cast.

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/lib.rs b/src/lib.rs
index 26b1d7e..6afc830 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -452,7 +452,7 @@ impl TOTP {
     pub fn check(&self, token: &str, time: u64) -> bool {
         let basestep = time / self.step - (self.skew as u64);
         for i in 0..(self.skew as u16) * 2 + 1 {
-            let step_time = (basestep + (i as u64)) * (self.step as u64);
+            let step_time = (basestep + (i as u64)) * self.step;
 
             if constant_time_eq(self.generate(step_time).as_bytes(), token.as_bytes()) {
                 return true;