How to use the md5 function in md5

To help you get started, we’ve selected a few md5 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github staticdeploy / staticdeploy / storage / src / BundlesClient.ts View on Github external
Body: assetContent,
                    Key: this.getAssetS3Key(id, asset.path)
                })
                .promise();
        });

        // Remove the temporary unpacking directory
        await remove(unpackingDirPath);

        // Create the bundle database object
        const bundle = await this.Bundle.create({
            id: id,
            name: partial.name,
            tag: partial.tag,
            description: partial.description,
            hash: md5(partial.content),
            assets: assets,
            fallbackAssetPath: partial.fallbackAssetPath,
            fallbackStatusCode: partial.fallbackStatusCode
        });

        return toPojo(bundle);
    }
github YaoZeyuan / zhihuhelp_with_node / src / command / generate / base.ts View on Github external
getImgName(src: string) {
    // 直接将路径信息md5
    let filename = ''
    try {
      let srcMd5 = md5(src)
      let urlObj = new url.URL(src)
      let pathname = urlObj.pathname
      if (path.extname(pathname) === '') {
        // 避免没有后缀名
        pathname = `${pathname}.jpg`
      }
      if (pathname.length > 50) {
        // 文件名不能过长, 否则用户无法直接删除该文件
        pathname = pathname.substr(pathname.length - 50, 50)
      }
      filename = StringUtil.encodeFilename(`${srcMd5}_${pathname}`)
    } catch (e) {
      // 非url, 不需要进行处理, 返回空即可
      logger.warn(`[警告]传入值src:${src}不是合法url, 将返回空filename`)
    }
    return filename
github dcos / dcos-ui / plugins / tracking / actions / Actions.js View on Github external
start() {
    this.createdAt = Date.now();
    this.lastLogDate = this.createdAt;
    this.stintID = md5(`session_${this.createdAt}`);

    hashHistory.listen(
      Util.debounce(location => {
        Actions.setActivePage(location.pathname + location.search);
      }, 200)
    );

    // Poll to deplete queue
    const checkAnalyticsReady = () => {
      setTimeout(() => {
        if (!this.canLog()) {
          checkAnalyticsReady();
        } else {
          this.drainQueue();
        }
      }, 200);
github vlsergey / WE-Framework / src / caches / actions.js View on Github external
const openTagF = fileName =&gt; '<div data-filename="\&quot;'">';
const closeTagF = () =&gt; '</div>';
github doramart / DoraCMS / src / api / index-server.js View on Github external
get(url, params = {}) {
        const key = md5(url + JSON.stringify(params))
        if (config.cached && params.cache && config.cached.has(key)) {
            return Promise.resolve(config.cached.get(key))
        }
        params.apiSource = 'server';
        return axios({
            method: 'get',
            url: config.api + url,
            params,
            timeout: config.timeout,
            headers: {
                'X-Requested-With': 'XMLHttpRequest'
            }
        }).then(res => {
            if (config.cached && params.cache) config.cached.set(key, res)
            return res
        })
github gardener / dashboard / frontend / src / utils / index.js View on Github external
export function gravatarUrl (value, image, size) {
  return `https://www.gravatar.com/avatar/${md5(toLower(value))}?d=${image}&s=${size}`
}
github LyricTian / gin-admin / web / src / utils / utils.js View on Github external
export function md5Hash(value) {
  return md5(value);
}
github nerdeveloper / hackathon-starter-kit / src / models / User.ts View on Github external
userSchema.virtual("gravatar").get(function() {
    const hash = md5(this.email);
    return `https://gravatar.com/avatar/${hash}?s=30`;
});
github elamperti / OpenWebScrobbler / src / store / actions / userActions.js View on Github external
.then((response) => {
        dispatch({
          type: `${USER_GET_INFO}_FULFILLED`,
          payload: response
        });
        if (response.data.user) {
          let hashedUserId = md5(response.data.user.name);
          ReactGA.set({
            userId: hashedUserId
          });
          saveToLocalStorage('hashedUID', hashedUserId);
        }
        if (response.data.settings) {
          setSettings(dispatch)(response.data.settings, false);
        }
      });
  }
github domagojk / beenion / model / link / getLinkId.ts View on Github external
export function getLinkId(userId: string, linkUrl: string) {
  return md5(`${userId}-${linkUrl}`)
}

md5

js function for hashing messages with MD5

BSD-3-Clause
Latest version published 4 years ago

Package Health Score

74 / 100
Full package analysis