NetAddr.length_to_mask

You're seeing just the function length_to_mask, go back to NetAddr module for more information.
Link to this function

length_to_mask(address_length, mask_length_in_bytes)

View Source

Specs

length_to_mask(non_neg_integer(), pos_integer()) :: binary()

Converts address_length to an address mask binary.

Examples

iex> NetAddr.length_to_mask(30, 4)
<<255, 255, 255, 252>>

iex> NetAddr.length_to_mask(64, 16)
<<255, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0>>

iex> NetAddr.length_to_mask(37, 6)
<<255, 255, 255, 255, 248, 0>>