當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript md5.default函數代碼示例

本文整理匯總了TypeScript中md5.default函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript default函數的具體用法?TypeScript default怎麽用?TypeScript default使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了default函數的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: Promise

		new Promise((resolve, reject) => {
			// No 'reject' thus far

			const https_options = {
				hostname: MailChimpHostName,
				path: MailChimpMembersPath + md5(emailaddress),
				method: 'DELETE',
				headers: {
					'Authorization': MailChimpAuthorization
				}
			}

			var req = https.request(https_options, (res: any) =>
				readResponseBody(res)
					.then((body: any) => {
						if (res.Status < 200 || res.Status >= 300) {
							BugTracker.InfoOnly('MailChimp API deleteMember', 'response.Status: ' + res.statusCode + ', response.Body: ' + body);
						}
					}));

			req.on('error', (err: Error) => BugTracker.Warning('MailChimp API deleteMember Warning', err.message));

			req.end();
			resolve(null);
		});
開發者ID:roderickmonk,項目名稱:rod-monk-sample-repo-ng2,代碼行數:25,代碼來源:MailChimp.ts

示例2: if

                complete: () => {
                    hash = md5(JSON.stringify(plugins.concat(hashStrings)));

                    if (bootstrappedPlugins.has(hash)) {
                        observer.next(bootstrappedPlugins.get(hash));
                        observer.complete();
                        return;
                    }

                    const command = [ctx.location, '-s', solutionLocation].concat(
                        plugins.map(x => {
                            if (x.location) {
                                return `--plugins ${x.location}`;
                            } else if (x.version) {
                                return `--plugin-name ${x.name}@${x.version}`;
                            } else {
                                return `--plugin-name ${x.name}`;
                            }
                        })).join(' ');

                    exec(command, (error, stdout) => {
                        if (error) {
                            observer.error(error);
                            return;
                        }
                        const location = stdout.toString().trim();
                        if (location) {
                            // restore(location, ctx, logger).subscribe(observer);
                            return;
                        }
                        observer.next(ctx.location);
                        observer.complete();
                    });
                }
開發者ID:OmniSharp,項目名稱:omnisharp-node-client,代碼行數:34,代碼來源:plugin.ts

示例3: deleteMember

function deleteMember(emailaddress) {

	var https_options = {
		hostname: MailChimpHostName,
		path: MailChimpMembersPath + md5(emailaddress),
		method: 'DELETE',
		headers: {
			'Authorization': MailChimpAuthorization
		}
	}

	return new Promise(function (resolve, reject) {
		// No 'reject' thus far

		var req = https.request(https_options, function (res) {
			readResponseBody(res)
				.then(function (body) {
					if (res.Status < 200 || res.Status >= 300)
						Track.InfoOnly('MailChimp API deleteMember', 'response.Status: ' + res.statusCode + ', response.Body: ' + body);
				});
		});

		req.on('error', function (e) {
			Track.Warning('MailChimp API deleteMember Warning', e.message);
		});

		req.end();
		resolve(null);
	});
}
開發者ID:roderickmonk,項目名稱:rod-monk-sample-repo,代碼行數:30,代碼來源:ttcMailChimp.ts

示例4: rp

 checkSubscriberByEmail() {
     const options = {
         url: 'https://us8.api.mailchimp.com/3.0/lists/74a478b46d/members/' + md5(this.email),
         method: 'GET',
         headers: {
             'Authorization': 'Basic ' + process.env.MAILCHIMP_API_KEY
         }
     }
     return rp(options);
 }
開發者ID:slamby,項目名稱:slamby-website,代碼行數:10,代碼來源:mailchimp.service.ts

示例5: hash

 /**
  * Return hash string of the config and textlint version
  * @returns {string}
  */
 get hash() {
     try {
         const version = pkgConf.sync({ cwd: __dirname }).pkg.version;
         const toString = JSON.stringify(this.toJSON());
         return md5(`${version}-${toString}`);
     } catch (error) {
         // Fallback for some env
         // https://github.com/textlint/textlint/issues/597
         Logger.warn("Use random value as hash because calculating hash value throw error", error);
         return crypto.randomBytes(20).toString("hex");
     }
 }
開發者ID:textlint,項目名稱:textlint,代碼行數:16,代碼來源:config.ts

示例6: it

 it("The set method should store the entry metadata", async () => {
   expect(cachemap.metadata).lengthOf(1);
   const metadata = cachemap.metadata[0];
   expect(metadata.accessedCount).to.equal(0);
   expect(metadata.added).to.be.a("number");
   expect(metadata.cacheability).to.be.instanceOf(Cacheability);
   expect(metadata.key).to.equal(md5(key));
   expect(metadata.lastAccessed).to.be.a("number");
   expect(metadata.lastUpdated).to.be.a("number");
   expect(metadata.size).to.be.a("number");
   expect(metadata.updatedCount).to.equal(0);
 });
開發者ID:badbatch,項目名稱:cachemap,代碼行數:12,代碼來源:index.ts

示例7: ascSign

export function ascSign(obj, key:string) {
  let keys = _.keys(obj).sort();
  let s = '';
  for(let k of keys) {
    let v = obj[k];
    if (k != 'sign' && v && typeof v != 'Array') {
      s += `${k}=${v}&`;
    }
  }
  s += `key=${key}`;
  console.log('str to sign:', s);
  s = md5(s);
  s = s.toUpperCase();
  return s;
}
開發者ID:yedf,項目名稱:wx-rest,代碼行數:15,代碼來源:util2.ts

示例8: generateHashMD5

 /**
  * 
  * 
  * @param {string} data
  * @returns {string}
  * 
  * @memberOf Algorithm
  */
 public static generateHashMD5(data:string):string{
     return md5(data);
 }
開發者ID:pankajtripathi,項目名稱:AngularjsCollections,代碼行數:11,代碼來源:Algorithms.ts

示例9: hash

 /**
  * Return hash string of the config and textlint version
  * @returns {string}
  */
 get hash() {
     const pkgConf = require("read-pkg-up");
     const version = pkgConf.sync({ cwd: __dirname }).pkg.version;
     const toString = JSON.stringify(this.toJSON());
     return md5(`${version}-${toString}`);
 }
開發者ID:,項目名稱:,代碼行數:10,代碼來源:


注:本文中的md5.default函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。