fixed a bug in TOTP calculation.

see https://keepass2android.codeplex.com/workitem/279

(if Math.pow(10,6) returns 999 999.99999 this was converted to 999 999 in the previous version)
This commit is contained in:
Philipp Crocoll 2014-10-26 06:17:27 +01:00
parent 3c5c9105b7
commit 6604ae292b

View File

@ -114,7 +114,7 @@ namespace OtpProviderClient
| ((hash[offset + 2] & 0xff) << 8) //Math.
| (hash[offset + 3] & 0xff); //Math.
int password = binary % (int)Math.Pow(10, _Length); //Math.
int password = binary % Convert.ToInt32(Math.Pow(10, _Length)); //Math.
return password.ToString(new string('0', _Length)); //Math.
}
}