When running TOTP under php 5.2.11 it falses to generate the otp correctly. I have narrowed it down to this line.
$otp = $binary % pow(10, $this->codeDigitsNr);
specifically the modulus gives bool(false) instead of an integer.
Christopher taylor - 2009-12-08 16:26:45 - In reply to message 2 from Protung Dragos
It only fails on my hosting company's server. The otp I get is 0000000010
If i use fmod($binary , pow(10, $this->codeDigitsNr));
It seems to work fine. I am now sure why it's failing though. I will get some output from the example later and post to you.
Im using a free hosting company called bytehost.com
You can setup a free account to test its immediate access.
Christopher taylor - 2009-12-08 18:17:51 - In reply to message 4 from Protung Dragos
I uploaded the example. It works with default number of digits but fails with 10 (which is what Ive been using).
here is the o/p with default setting. Notice to 0 seconds all the time. i think the problem is due to the integer length. The seconds produce fine on my pc.
Original time : 1260290364
Original password : 1477860
Expiration time: 30s