Erlang/OTP Forums

Author Message

<  Erlang  ~  fastest binary reverse

keymone
Posted: Tue Jan 06, 2009 11:15 am Reply with quote
User Joined: 17 Sep 2007 Posts: 11 Location: Lviv, Ukraine
i found this while i was playing with Erlang

if you have relatively small binary(up to 2MB) the fastest way to reverse it is this:

Code:

reverse(Binary) ->
  S = size(Binary),
  <<L:S/integer-little>> = Binary,
  <<L:S/integer-big>>.


don't know any faster way to do that
View user's profile Send private message MSN Messenger ICQ Number

Display posts from previous:  

All times are GMT
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.

Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum