本文整理汇总了TypeScript中long.toString函数的典型用法代码示例。如果您正苦于以下问题:TypeScript toString函数的具体用法?TypeScript toString怎么用?TypeScript toString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了toString函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: PrintReplicaID
export function PrintReplicaID(
rangeID: Long,
rep: protos.cockroach.roachpb.IReplicaDescriptor,
nodeID?: number,
storeID?: number,
replicaID?: Long,
) {
if (!_.isNil(rep)) {
return `n${rep.node_id} s${rep.store_id} r${rangeID.toString()}/${rep.replica_id}`;
}
// Fall back to the passed in node, store and replica IDs. If those are nil,
// use a question mark instead.
const nodeIDString = _.isNil(nodeID) ? "?" : nodeID.toString();
const storeIDString = _.isNil(storeID) ? "?" : storeID.toString();
const replicaIDString = _.isNil(replicaID) ? "?" : replicaID.toString();
return `n${nodeIDString} s${storeIDString} r${rangeID.toString()}/${replicaIDString}`;
}
示例2: generateAppId
export function generateAppId(executableLocation: string, title: string) {
//From https://github.com/Hafas/node-steam-shortcuts
let crcValue = crc.crc32(executableLocation + title);
let longValue = new long(crcValue, crcValue, true);
longValue = longValue.or(0x80000000);
longValue = longValue.shl(32);
longValue = longValue.or(0x02000000);
return longValue.toString();
}
示例3: PrintReplicaID
export function PrintReplicaID(rangeID: Long, rep: protos.cockroach.roachpb.ReplicaDescriptor$Properties) {
return `n${rep.node_id} s${rep.store_id} r${rangeID.toString()}/${rep.replica_id}`;
}