Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add port provider #409

Merged
merged 1 commit into from
Sep 29, 2022
Merged

Conversation

panilya
Copy link
Collaborator

@panilya panilya commented Sep 28, 2022

No description provided.

@panilya panilya force-pushed the provider/internet-port branch from ececad3 to 7d8cb64 Compare September 28, 2022 07:26
@panilya panilya force-pushed the provider/internet-port branch 4 times, most recently from 9bb8e5c to dd6a72b Compare September 28, 2022 17:37
* @return a port number
*/
public int port() {
return faker.random().nextInt(1, 65535);
Copy link
Collaborator

@snuyanzin snuyanzin Sep 28, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on RFC 6335 https://www.rfc-editor.org/info/rfc6335
allowed range is [0, 65535] so it should be return faker.random().nextInt(0, 65535);
same for test and doc

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

@panilya panilya force-pushed the provider/internet-port branch from dd6a72b to 84b1777 Compare September 28, 2022 18:49
@panilya panilya force-pushed the provider/internet-port branch from 84b1777 to 9a6e2ed Compare September 28, 2022 21:33
@bodiam
Copy link
Contributor

bodiam commented Sep 28, 2022

Looks good to me!

@panilya panilya merged commit 5814964 into datafaker-net:main Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants