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);