[erlang-questions] Reverses Order of Bytes in Binary

Max Lapshin max.lapshin@REDACTED
Fri Jan 9 15:03:20 CET 2015


reverse(Bin) ->
  reverse(Bin, <<>>).

reverse(<<>>, Acc) -> Acc;
reverse(<<C,Bin/binary>>, Acc) -> reverse(Bin, <<Acc/binary, C>>).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150109/8af805a8/attachment.htm>


More information about the erlang-questions mailing list