Skip to content

Commit

Permalink
fix: pad hotp and totp values to 6 digits
Browse files Browse the repository at this point in the history
  • Loading branch information
gizmo-ds committed May 25, 2023
1 parent 341d21c commit e47d76b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/browser/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ const timestamp = () => Math.round(new Date().getTime() / 1000)
function updateValue() {
if (!initialized) return
const t = BigInt(timestamp())
hotp_value = hotp(secret, BigInt(hotp_counter), digits).toString()
totp_value = totp(secret, t, digits, period).toString()
hotp_value = hotp(secret, BigInt(hotp_counter), digits).toString().padStart(6, '0')
totp_value = totp(secret, t, digits, period).toString().padStart(6, '0')
steam_value = steam_guard(secret, t)
}
Expand Down

0 comments on commit e47d76b

Please sign in to comment.