Check if the code is correct. This will accept codes starting from $discrepancy*30sec ago to $discrepancy*30sec from now.
public verifyCode ( string $secret, string $code, integer $discrepancy = 1, integer | null $currentTimeSlice = null ) : boolean | ||
$secret | string | |
$code | string | |
$discrepancy | integer | This is the allowed time drift in 30 second units (8 means 4 minutes before or after) |
$currentTimeSlice | integer | null | time slice if we want use other that time() |
return | boolean |