本文整理汇总了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;未经允许,请勿转载。 |
请发表评论