Added pull request from GitHub https://github.com/Lisoveliy/totpfit/pull/1, fix of settings app #11

Merged
Lisoveliy merged 3 commits from from-mirror into main 2025-08-08 14:39:41 +02:00
2 changed files with 4 additions and 4 deletions
Showing only changes of commit d45be3ee68 - Show all commits

View File

@ -54,6 +54,6 @@ export function getTOTP(
timeOffset = 0,
hashType = "SHA-1",
) {
const unixTime = Math.round((time / 1000 + timeOffset) / fetchTime);
return getHOTP(BigInt(unixTime), secret, digits);
const unixTime = Math.round((time / 1000n + timeOffset) / fetchTime);
return getHOTP(BigInt(unixTime), secret, digits, hashType);
}

View File

@ -48,7 +48,7 @@ export class TOTP {
*/
getOTP(time = Date.now()) {
const unixTime = (time / 1000 + this.timeOffset) / this.fetchTime;
const otp = getHOTP(Math.floor(unixTime), this.secret, this.digits);
const otp = getHOTP(Math.floor(unixTime), this.secret, this.digits, this.hashType);
const expireTime =
time +
(this.fetchTime -