Skip to content

Commit

Permalink
Merge 3115dbb into cb58351
Browse files Browse the repository at this point in the history
  • Loading branch information
mustapha1509 committed Mar 5, 2020
2 parents cb58351 + 3115dbb commit 81ba0f0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions index.js
Expand Up @@ -37,8 +37,7 @@ exports.digest = function digest (options) {

// convert secret to buffer
if (!Buffer.isBuffer(secret)) {
if (encoding === 'base32') { secret = base32.decode(secret); }
secret = new Buffer(secret, encoding);
secret = encoding === 'base32' ? new Buffer(base32.decode(secret)) : new Buffer(secret, encoding);
}

var secret_buffer_size;
Expand Down

0 comments on commit 81ba0f0

Please sign in to comment.