Function - generate_port

Contents

Function - generate_port#

openfl.utilities.utils.generate_port(hash, port_range=(49152, 60999))[source]#

Generate a deterministic port number based on a hash and a unique key.

Parameters:
  • hash (str) – A string representing the hash of the plan.

  • port_range (tuple) – A tuple containing the minimum and maximum port numbers (inclusive). The default range is (49152, 60999).

Returns:

A port number within the specified range.

Return type:

int