We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a30d209 + 032740f commit 41d4e57Copy full SHA for 41d4e57
src/libraries/Port.ts
@@ -1,3 +1,6 @@
1
+import { randomInt } from "crypto"
2
+
3
export function GenerateRandomPort() {
- return Math.floor(Math.random() * (65535 - 1024) + 1025)
4
+ //Min is inclusive and max is exclusive. Inclusive range would be 1025 - 65535
5
+ return randomInt(1025, 65536)
6
}
0 commit comments