code: function (digest, iterationCount) {
  
          var derive = function (password, salt, len) {
              var key, i, tmpBuf;
              if (len > digest.digestLength()) {
                  throw "Key length larger than digest length";
              }
              digest.reset();
              digest.update(password);
              digest.update(salt);
              tmpBuf = digest.finalize();
              for (i = 1; i < iterationCount; i++) {
                  tmpBuf = digest.digest(tmpBuf);
              }
              return tmpBuf.slice(0, len);
          };
  
          return {
              deriveKey: function (password, salt, len) {
                  return derive(convertToUint8Array(password), convertToUint8Array(salt), len);
              }
          };
      }
docs: /* PBKDF1 Implementation