How to use the ts-md5/dist/md5.Md5.hashStr function in ts-md5

To help you get started, we’ve selected a few ts-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 yduartep / angular-full-sample / src / app / core / services / auth.helper.ts View on Github external
case AuthScheme.BEARER:
        const token = CommonUtil.getCookie(AuthHelper.TOKEN_ID);
        if (!CommonUtil.isEmpty(token)) {
          headers.set('Authorization', 'Bearer ' + token);
        }
        break;
      case AuthScheme.DIGEST:
        if (!CommonUtil.isEmpty(user)) {
          // TODO check from where arrive this fields
          const nonce = 'dcd98b7102dd2f0e8b11d0f600bfb0c093';
          const nc = '00000001';
          const cnonce = '0a4f113b';
          const opaque = '5ccc069c403ebaf9f0171e9517f40e41';
          const qop = 'auth';

          const HA1 = Md5.hashStr(user.username + ':' + user.email + ':' + user.password);
          const HA2 = Md5.hashStr(method + ':' + uri);
          const response = Md5.hashStr(HA1 + ':' + nonce + ':' + nc + ':' + cnonce + ':' + qop + ':' + HA2);

          headers.set('Authorization', 'Digest ' +
            ' username="' + user.username + '",' +
            ' realm="' + user.email + '",' +
            ' nonce="' + nonce + '",' +
            ' uri="' + uri + '",' +
            ' qop=auth,' +
            ' nc=' + nc + ',' +
            ' cnonce="' + cnonce + '",' +
            ' response="' + response + '",' +
            ' opaque="' + opaque + '"');
        }
        break;
      case AuthScheme.HOBA:
github cloudfoundry / stratos / src / frontend / app / shared / data-services / scm / gitlab-scm.ts View on Github external
private convertCommit(projectName: string, commit: any): GitCommit {
    const emailMD5 = Md5.hashStr(commit.author_email);
    const avatarURL = `https://secure.gravatar.com/avatar/${emailMD5}?s=120&d=identicon`;

    return {
      html_url: this.getCommitURL(projectName, commit.id),
      author: {
        id: null,
        login: null,
        avatar_url: avatarURL,
        html_url: null
      },
      commit: {
        author: {
          date: commit.created_at,
          name: commit.author_name,
          email: commit.author_email
        },
github lhzbxx / Follow3 / mobile / app / providers / data-service.js View on Github external
resetPassword(email, password, nav) {
        let url = this.BASE_URL + 'auth/reset';
        let body = JSON.stringify({'email': email, 'password': Md5.hashStr(password)});
        let headers = new Headers({'Content-Type': 'application/json'});
        return new Promise(resolve => {
            this.http.patch(url, body, {headers: headers})
                .map(res => res.json())
                .subscribe(data => {
                    console.log(data.msg);
                    if (data.status == 200) {
                        resolve();
                    } else {
                        this.showToast('修改失败...', 2000, nav);
                    }
                }, error => {
                    this.showToast('无法连接到服务器...', 2000, nav);
                });
        });
    }
github aws / lumberyard / dev / Gems / CloudGemFramework / v1 / Website / CloudGemPortal / app / view / game / module / cloudgems / service / cachehandler.service.ts View on Github external
public exists(key: string): boolean {        
        var encryptedKeyString = Md5.hashStr(key).toString();
        var valueExists = this.cacheMap.has(encryptedKeyString);
        if (valueExists) {
            return true;
        }
        return false;
    }
    public objectExists(key: any): boolean {
github search-future / miyou.tv / miyoutv / src / app / shared / garapon.service.ts View on Github external
get md5password(): string {
    return Md5.hashStr(this.password) as string;
  }
github jan-molak / serenity-js / packages / serenity-js / src / serenity / reporting / serenity_bdd_reporter.ts View on Github external
private persistReportFor({ value }: SceneFinished) {
        const filename = `${ Md5.hashStr(value.subject.id) }.json`;

        this.stage.manager.informOfWorkInProgress(
            RehearsalReport.from(this.stage.manager.readNewJournalEntriesAs('SerenityBDDReporter'))
                .exportedUsing(new SerenityBDDReportExporter())
                .then((fullReport: FullReport) => Promise.all(
                    fullReport.scenes.map(
                        (scene: SceneReport) => this.fs.store(filename, JSON.stringify(scene)),
                    ),
                )),
        );
    }
}
github aws / lumberyard / dev / Gems / CloudGemFramework / v1 / Website / CloudGemPortal / app / view / game / module / cloudgems / service / cachehandler.service.ts View on Github external
public set(key: string, value: any, options?: any): void {
        var encryptedKeyString = Md5.hashStr(key).toString();
        this.cacheMap.set(encryptedKeyString, value);
    }
    public setObject(key: any, value: any, options?: any): void {
github wikift / wikift / wikift-web / src / app / pages / article / info / info.article.component.ts View on Github external
initViewArticle() {
        const articleView = new ArticleViewParamModel();
        articleView.userId = this.article.user.id;
        articleView.articleId = this.article.id;
        articleView.viewCount = 1;
        const hashStr = this.deviceService.userAgent + this.deviceService.browser +
            + this.deviceService.browser_version + + this.deviceService.os + this.deviceService.os_version
            + articleView.userId + articleView.articleId;
        articleView.device = Md5.hashStr(hashStr);
        this.articleService.viewArticle(articleView).subscribe(
            result => {
            }
        );
    }
github infra-geo-ouverte / igo2-lib / src / lib / datasource / shared / datasources / wmts-datasource.ts View on Github external
protected generateId() {
    const layer = this.options.layer;
    const chain = 'wmts' + this.options.url + layer;

    return Md5.hashStr(chain) as string;
  }

ts-md5

TypeScript MD5 implementation

MIT
Latest version published 2 years ago

Package Health Score

68 / 100
Full package analysis