Skip to content

Commit

Permalink
Set default value for digits in HOTP.validate, fixes #550
Browse files Browse the repository at this point in the history
  • Loading branch information
hectorm committed Sep 28, 2024
1 parent 8507037 commit de62295
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hotp.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ class HOTP {
* @param {string} config.token Token value.
* @param {Secret} config.secret Secret key.
* @param {string} [config.algorithm='SHA1'] HMAC hashing algorithm.
* @param {number} config.digits Token length.
* @param {number} [config.digits=6] Token length.
* @param {number} [config.counter=0] Counter value.
* @param {number} [config.window=1] Window of counter values to test.
* @returns {number|null} Token delta or null if it is not found in the search window, in which case it should be considered invalid.
Expand All @@ -146,7 +146,7 @@ class HOTP {
token,
secret,
algorithm,
digits,
digits = HOTP.defaults.digits,
counter = HOTP.defaults.counter,
window = HOTP.defaults.window,
}) {
Expand Down

0 comments on commit de62295

Please sign in to comment.