Godd Morning,
I am trying to perform a check sum on the following function
Data = [<<"9">>,"81",
<<1>>,
<<"52=">>,
[[50,48,49,48,49,48,50,54,45,49,53,":",52,53,":",52,52]],
<<1>>,
<<1>>,
[<<"9">>,<<"0">>,<<1>>],
[<<"5">>,<<"4">>,<<1>>]]
Using:
checksum(Data) -> checksum(Data, 0).
checksum([H | T], Acc) ->
if
is_binary(H) ->
I = binary_to_list(H);
true ->
I = H
end,
checksum(T, I + Acc);
checksum([], Acc) -> Acc.
It basically needs to break the Data down into discrete numbers
ideally it would look like [56,45,34,111,233,...]
and then add them all together.
The compiler gives me errors no matter what I try. I had it solved before it was very simple, but now one change up the food chain affected this.
Please help, and best wishes!