<html><head></head><body>there's another way:<br>
<br>
reverse(Bin) when is_binary(Bin) -><br>
<br>
S = bit_size(Bin),<br>
<br>
<<V:S/integer-little>> = Bin,<br>
<br>
<<V:S/integer-big>>.<br>
<br>
<br>
<br><br><div class="gmail_quote">On January 10, 2015 12:24:54 PM CET, "Сергей Прохоров" <<a href="http://seriy.pr">seriy.pr</a>@gmail.com> wrote:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div dir="ltr">Probably this one will be more effective<div><br /></div><div><div>reverse(Bin) -></div><div> reverse(Bin, byte_size(Bin)).</div><div><br /></div><div>reverse(_, 0) -> <<>>;</div><div>reverse(Bin, Pos) -></div><div> <<(binary:at(Bin, Pos - 1)), (reverse(Bin, Pos - 1))/binary >>.</div></div></div>
<p style="margin-top: 2.5em; margin-bottom: 1em; border-bottom: 1px solid #000"></p><pre class="k9mail"><hr /><br />erlang-questions mailing list<br />erlang-questions@erlang.org<br /><a href="http://erlang.org/mailman/listinfo/erlang-questions">http://erlang.org/mailman/listinfo/erlang-questions</a><br /></pre></blockquote></div></body></html>