diff --git a/src/libraries/Port.ts b/src/libraries/Port.ts index 959b649..3531780 100644 --- a/src/libraries/Port.ts +++ b/src/libraries/Port.ts @@ -1,3 +1,6 @@ +import { randomInt } from "crypto" + export function GenerateRandomPort() { - return Math.floor(Math.random() * (65535 - 1024) + 1025) + //Min is inclusive and max is exclusive. Inclusive range would be 1025 - 65535 + return randomInt(1025, 65536) } \ No newline at end of file