Added hacknet node api functions for spending hashes. Fixed several bugs with v0.46.0. Rebalanced hash upgrades. continued working on terminal directory implementation

This commit is contained in:
danielyxie
2019-04-05 02:08:41 -07:00
parent fb857642e8
commit 3241945452
30 changed files with 576 additions and 314 deletions
+12
View File
@@ -0,0 +1,12 @@
// Function that generates a random gibberish string of length n
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
export function createRandomString(n: number): string {
let str: string = "";
for (let i = 0; i < n; ++i) {
str += chars.charAt(Math.floor(Math.random() * chars.length));
}
return str;
}