Help to make (and understand) better and beautiful code

Your right!!! also that pointed me to an edge case…

The correct version is:

  defp padding(%__MODULE__{} = value) do
    fix = if (value.input_length + 1) == byte_size(value.buffer) do
      value.buffer
      |> binary_part(0, value.input_length)
      |> set_value(<<0x81>>)