bitburner-src/utils/IPAddress.ts

15 lines
363 B
TypeScript
Raw Normal View History

import { getRandomByte } from "./helpers/getRandomByte";
2019-03-03 04:15:10 +01:00
/**
* Generate a random IP address
* Does not check to see if the IP already exists in the game
*/
2019-03-03 04:15:10 +01:00
export function createRandomIp(): string {
const ip: string = getRandomByte(99) + '.' +
getRandomByte(9) + '.' +
getRandomByte(9) + '.' +
getRandomByte(9);
return ip;
}