Skip to content

support cidr #2252

@unional

Description

@unional

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    c: featureRequest for new featurem: internetSomething is referring to the internet modulep: 1-normalNothing urgents: waiting for user interestWaiting for more users interested in this feature

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions