From 6dc3eb6b6e5d78cccf6de12deb687daac92f7470 Mon Sep 17 00:00:00 2001 From: Ben <105461985+ben-ekw@users.noreply.github.com> Date: Mon, 23 May 2022 18:10:03 -0700 Subject: [PATCH] fixes #38 ref https://github.com/h2non/jshashes/pull/44 --- hashes.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hashes.js b/hashes.js index f400c12..280a4ce 100644 --- a/hashes.js +++ b/hashes.js @@ -294,11 +294,11 @@ // public method for encoding this.encode = function(input) { var i, j, triplet, - output = '', - len = input.length; + output = ''; pad = pad || '='; input = (utf8) ? utf8Encode(input) : input; + len = input.length; for (i = 0; i < len; i += 3) { triplet = (input.charCodeAt(i) << 16) | (i + 1 < len ? input.charCodeAt(i + 1) << 8 : 0) | (i + 2 < len ? input.charCodeAt(i + 2) : 0);