[Home](./index.md) > [bitburner](./bitburner.md) > [Hacknet](./bitburner.hacknet.md) > [hashCost](./bitburner.hacknet.hashcost.md) ## 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: ```typescript hashCost(upgName: HashUpgrades): number; ``` ## Parameters | Parameter | Type | Description | | --- | --- | --- | | upgName | [HashUpgrades](./bitburner.hashupgrades.md) | Name of the upgrade of Hacknet Node. | Returns: number Number of hashes required for the specified upgrade. ## Remarks RAM cost: 0 GB ## Example ```ts var upgradeName = "Sell for Corporation Funds"; if (hacknet.numHashes() > hacknet.hashCost(upgradeName)) { hacknet.spendHashes(upgName); } ```