bitburner-src/markdown/bitburner.hacknet.hashcost.md
Olivier Gagnon 2b79871c02 doc
2021-11-03 00:27:21 -04:00

976 B

Home > bitburner > Hacknet > hashCost

Hacknet.hashCost() method

Get the cost of a hash upgrade.

Signature:

hashCost(upgName: string): number;

Parameters

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

Returns:

number

Number of hashes required for the specified upgrade.

Remarks

RAM cost: 0 GB

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.

Example

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