OnFlow.Util.pad

You're seeing just the function pad, go back to OnFlow.Util module for more information.
Link to this function

pad(list, count, direction \\ :left)

View Source

Specs

pad(binary() | [binary()], integer(), :left | :right) :: binary()

Pads a given binary or list of binaries with null bytes until the given binary reaches the given byte size. direction can be either :left or :right, but defaults to :left.

If count is not a positive integer, the binary is returned unchanged.

iex> pad(<<91, 77>>, 4)
<<0, 0, 91, 77>>

iex> pad(<<91, 77>>, 4, :right)
<<91, 77, 0, 0>>

iex> pad([<<91, 77>>, <<129>>], 4, :right)
[<<91, 77, 0, 0>>, <<129, 0, 0, 0>>]

iex> pad([<<91, 77>>, <<129>>], 0)
[<<91, 77>>, <<129>>]