diff options
Diffstat (limited to 'lib/script_entries/crypto.js')
-rw-r--r-- | lib/script_entries/crypto.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/script_entries/crypto.js b/lib/script_entries/crypto.js index d8d9c0a..9393e8b 100644 --- a/lib/script_entries/crypto.js +++ b/lib/script_entries/crypto.js @@ -37,11 +37,14 @@ CryptoString.prototype.init = function(hashAlgorithm, charset) { }; CryptoString.prototype.encryptString = function(str) { + var me = this; var result = {}; var data = this.converter.convertToByteArray(str, result); this.cryptoHash.update(data, data.length); var hash = this.cryptoHash.finish(false); - return [this.toHexString(hash.charCodeAt(i)) for (i in hash)].join(""); + return Array.from( + hash, + (c, i) => me.toHexString(hash.charCodeAt(i))).join(''); }; CryptoString.prototype.toHexString = function(charCode) { |