We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
See TODO:
defp decode_extended(delta_sum, delta, length, tail) do {tail1, key} = cond do delta < 13 -> {tail, delta_sum + delta} delta == 13 -> # TODO: size here `::size(4)`? <<key, new_tail1::binary>> = tail {new_tail1, delta_sum + key + 13} delta == 14 -> <<key::size(16), new_tail1::binary>> = tail {new_tail1, delta_sum + key + 269} end {tail2, option_length} = cond do length < 13 -> {tail1, length} length == 13 -> # TODO: size here `::size(4)`? <<extended_option_length, new_tail2::binary>> = tail1 {new_tail2, extended_option_length + 13} length == 14 -> <<extended_option_length::size(16), new_tail2::binary>> = tail1 {new_tail2, extended_option_length + 269} end {key, option_length, tail2} end
The text was updated successfully, but these errors were encountered:
See also:
defp encode([{key, value} | option_list], delta_sum, acc) do {delta, extended_number} = cond do key - delta_sum >= 269 -> {14, <<key - delta_sum - 269::size(16)>>} key - delta_sum >= 13 -> {13, <<key - delta_sum - 13>>} true -> {key - delta_sum, <<>>} end {length, extended_length} = cond do byte_size(value) >= 269 -> {14, <<byte_size(value) - 269::size(16)>>} byte_size(value) >= 13 -> {13, <<byte_size(value) - 13>>} true -> {byte_size(value), <<>>} end acc2 = << acc::binary, delta::size(4), length::size(4), # TODO: what size should this be? extended_number::binary, extended_length::binary, value::binary >> encode(option_list, key, acc2) end
Sorry, something went wrong.
No branches or pull requests
See TODO:
The text was updated successfully, but these errors were encountered: