Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: Fastest byteswap (little endian to big endian (eg. 34127856 -> 12345678)

by ikegami (Patriarch)
on Apr 14, 2015 at 12:50 UTC ( [id://1123402]=note: print w/replies, xml ) Need Help??


in reply to Re: Fastest byteswap (little endian to big endian (eg. 34127856 -> 12345678)
in thread Fastest byteswap (little endian to big endian (eg. 34127856 -> 12345678)

Shouldn't that be substr($data,1) (skip the NUL)?
  • Comment on Re^2: Fastest byteswap (little endian to big endian (eg. 34127856 -> 12345678)
  • Download Code

Replies are listed 'Best First'.
Re^3: Fastest byteswap (little endian to big endian (eg. 34127856 -> 12345678)
by dave_the_m (Monsignor) on Apr 14, 2015 at 13:03 UTC
    I see you've already corrected your post, but for anyone else wondering: even bytes have to be shifted left one slot; odd ones right one slot; the difference between -1 and +1 is 2, not 1.

    Dave.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1123402]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-25 13:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found