Skip to content

Commit 78d6eb4

Browse files
josephfuscoCopilot
andauthored
Apply suggestion from @Copilot
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 7ef2646 commit 78d6eb4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/get-ports.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const PORT_BASE = 100;
4848
*/
4949
function hashToPort(str) {
5050
const hash = crypto.createHash('sha256').update(str).digest('hex');
51-
// Take first 8 hex chars and convert to decimal, then mod PORT_RANGE + PORT_BASE to get range [PORT_BASE, PORT_BASE + PORT_RANGE - 1]
51+
// Take first 8 hex chars and convert to decimal, then take (num % PORT_RANGE) + PORT_BASE to get range [PORT_BASE, PORT_BASE + PORT_RANGE - 1]
5252
// This ensures we skip the first PORT_BASE ports to avoid conflicts with common services
5353
const num = parseInt(hash.substring(0, 8), 16);
5454
return (num % PORT_RANGE) + PORT_BASE;

0 commit comments

Comments
 (0)