ipPrefix
Description
Return the CIDR subnet for a given IP address and subnet size.
Syntax
Like many functions in DataPrime, ipPrefix
supports two notations, function and method notation. These interchangeable forms allow flexibility in how you structure expressions.
Arguments
Name | Type | Required | Description |
---|---|---|---|
ip | string | true | The IP address to process |
subnetSize | number | true | Number of mask bits in the subnet, e.g. 10 produces a /10 CIDR range |
Example
Use case: Derive the subnet from an IP address
Compute the subnet for a given IP when the number of mask bits is known.
Output
Theme
Light