     end
   end
 
+  @spec valid_kind?(binary, kind) :: boolean
+
   defp valid_kind?(_str, :ascii), do: true
-
   defp valid_kind?(str, :dec), do: Helpers.dec?(str)
-
   defp valid_kind?(str, :hex), do: Helpers.hex?(str)
 
+  @spec octet_string(binary, non_neg_integer) :: pack_result
+
   def octet_string(str, _length) when not is_binary(str), do: {:error, @invalid_octet_string}
-
   def octet_string(str, length) when is_integer(length) and length >= 0 do
     if byte_size(str) == length do
       {:ok, str}

  def c_octet_string(str, {:max, max}, kind) when is_integer(max) and max >= 1 do
    c_octet_string_with_general_check(str, &(&1 <= max), kind)
  end

  defp c_octet_string_with_general_check(str, check, kind) when is_function(check) do
    str_length = byte_size(str)

      {:error, @invalid_octet_string}
    end
  end

  @spec tlv(integer, binary) :: pack_result

  def tlv(_tag, str) when not is_binary(str), do: {:error, @invalid_tlv_value}
  def tlv(tag, _str) when not is_integer(tag), do: {:error, @invalid_tlv_tag}
