<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [bitburner](./bitburner.md) &gt; [HacknetServersFormulas](./bitburner.hacknetserversformulas.md) &gt; [hashUpgradeCost](./bitburner.hacknetserversformulas.hashupgradecost.md)

## HacknetServersFormulas.hashUpgradeCost() method

Calculate hash cost of an upgrade.

**Signature:**

```typescript
hashUpgradeCost(upgName: HacknetServerHashUpgrade, level: number): number;
```

## Parameters

<table><thead><tr><th>

Parameter


</th><th>

Type


</th><th>

Description


</th></tr></thead>
<tbody><tr><td>

upgName


</td><td>

[HacknetServerHashUpgrade](./bitburner.hacknetserverhashupgrade.md)


</td><td>

name of the upgrade


</td></tr>
<tr><td>

level


</td><td>

number


</td><td>

level of the upgrade


</td></tr>
</tbody></table>

**Returns:**

number

The calculated hash cost.

