bitburner-src/markdown/bitburner.hacknet.hashcost.md
Olivier Gagnon 43fc5dfd48 work on doc
2021-10-30 12:34:14 -04:00

976 B

Home > bitburner > HackNet > hashCost

HackNet.hashCost() method

This function is only applicable for Hacknet Servers (the upgraded version of a Hacknet Node).

Returns the number of hashes required for the specified upgrade. The name of the upgrade must be an exact match.

Signature:

hashCost(upgName: HashUpgrades): number;

Parameters

Parameter Type Description
upgName HashUpgrades Name of the upgrade of Hacknet Node.

Returns:

number

Number of hashes required for the specified upgrade.

Remarks

0 GB

Example

var upgradeName = "Sell for Corporation Funds";
if (hacknet.numHashes() > hacknet.hashCost(upgradeName)) {
   hacknet.spendHashes(upgName);
}