From 22e48620d1da8281d9f6dce3ac2141a59a5a77d2 Mon Sep 17 00:00:00 2001 From: Martin Vonheim Larsen Date: Sat, 23 Aug 2014 12:32:08 +0200 Subject: [PATCH] Fixed issue with hash algorithm using Browserify Fixes #14. --- index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/index.js b/index.js index 189a9aa..f2727d2 100644 --- a/index.js +++ b/index.js @@ -27,7 +27,7 @@ hotp.gen = function(key, opt) { // Create the byte array var b = new Buffer(intToBytes(counter)); - var hmac = crypto.createHmac('SHA1', new Buffer(key)); + var hmac = crypto.createHmac('sha1', new Buffer(key)); // Update the HMAC with the byte array var digest = hmac.update(b).digest('hex'); @@ -215,4 +215,3 @@ var hexToBytes = function(hex) { } return bytes; }; -