<div dir="ltr">Thanks a lot all, that was the only know I knew based on what I found in documentation, but I learnt lot other ways to do it.<div><br></div><div>Plus, One thing I learnt is how to measure performance, so Thank you all for your time and effort</div><div>+ Harit</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jan 10, 2015 at 5:07 AM, Michael Uvarov <span dir="ltr"><<a href="mailto:freeakk@gmail.com" target="_blank">freeakk@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>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"><div><div class="h5">On January 10, 2015 12:24:54 PM CET, "Сергей Прохоров" <<a href="http://seriy.pr" target="_blank">seriy.pr</a>@<a href="http://gmail.com" target="_blank">gmail.com</a>> wrote:</div></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div class="h5">
<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></div></div><pre><hr><span class=""><br>erlang-questions mailing list<br><a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br><a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br></span></pre></blockquote></div></div><br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>