瀏覽代碼

Fixes the lint problems and add JSDoc

slurdge 7 年之前
父節點
當前提交
7feafbf0e7
共有 1 個文件被更改,包括 8 次插入2 次删除
  1. 8 2
      src/core/operations/Hash.js

+ 8 - 2
src/core/operations/Hash.js

@@ -16,12 +16,18 @@ import Checksum from "./Checksum.js";
  */
 const Hash = {
 
+    /** Generic hash function
+     *
+     * @param {string} name
+     * @param {string} input
+     * @returns {string}
+     */
     runHash: function(name, input) {
-        var hasher = CryptoApi.hasher(name);
+        let hasher = CryptoApi.hasher(name);
         hasher.state.message = input;
         hasher.state.length += input.length;
         hasher.process();
-        return hasher.finalize().stringify('hex');
+        return hasher.finalize().stringify("hex");
     },
 
     /**