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

support cidr #2252

Open
unional opened this issue Jul 14, 2023 · 3 comments
Open

support cidr #2252

unional opened this issue Jul 14, 2023 · 3 comments
Labels
c: feature Request for new feature m: internet Something is referring to the internet module p: 1-normal Nothing urgent s: waiting for user interest Waiting for more users interested in this feature
Milestone

Comments

@unional
Copy link

unional commented Jul 14, 2023

Clear and concise description of the problem

Add support to generate IP CIDR:

https://aws.amazon.com/what-is/cidr/#:~:text=CIDR%20notation%20represents%20an%20IP,1.0%2F22.
https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing

Suggested solution

Add as an option to faker.internet.ipv4(...) and faker.internet.ipv6(...).

faker.internet.ipv4({ maskBit: 24 }) // 192.168.1.0/24

faker.internet.ipv4({ maskBit: { min: 8, max: 32 }}) // 10.0.0.0/10

Alternative

No response

Additional context

No response

@unional unional added c: feature Request for new feature s: pending triage Pending Triage s: waiting for user interest Waiting for more users interested in this feature labels Jul 14, 2023
@github-actions
Copy link
Contributor

Thank you for your feature proposal.

We marked it as "waiting for user interest" for now to gather some feedback from our community:

  • If you would like to see this feature be implemented, please react to the description with an up-vote (:+1:).
  • If you have a suggestion or want to point out some special cases that need to be considered, please leave a comment, so we are aware about them.

We would also like to hear about other community members' use cases for the feature to give us a better understanding of their potential implicit or explicit requirements.

We will start the implementation based on:

  • the number of votes (:+1:) and comments
  • the relevance for the ecosystem
  • availability of alternatives and workarounds
  • and the complexity of the requested feature

We do this because:

  • There are plenty of languages/countries out there and we would like to ensure that every method can cover all or almost all of them.
  • Every feature we add to faker has "costs" associated to it:
    • initial costs: design, implementation, reviews, documentation
    • running costs: awareness of the feature itself, more complex module structure, increased bundle size, more work during refactors

View more issues which are waiting for user interest

@ST-DDT ST-DDT added this to the vFuture milestone Jul 14, 2023
@ST-DDT ST-DDT added p: 1-normal Nothing urgent m: internet Something is referring to the internet module and removed s: pending triage Pending Triage labels Jul 14, 2023
@xDivisionByZerox
Copy link
Member

Thank you for your suggestion @unional.

To better weigh the importance of your feature, it would help if you could provide the information on whether this is a "nice to have" feature request or if you have an actual use case.
If you have an actual use case, it would help if you could provide it as well.

@unional
Copy link
Author

unional commented Jul 15, 2023

Hi,

Yes. It is an actual use case.

You can kind of mimic this by string concatenation,
except that the subnet mask must be 0 to the number of bits in IPv4 or IPv6.

That's why it is better to provided by faker instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: feature Request for new feature m: internet Something is referring to the internet module p: 1-normal Nothing urgent s: waiting for user interest Waiting for more users interested in this feature
Projects
None yet
Development

No branches or pull requests

3 participants