本文整理匯總了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}`;
}