Skip to content

Instantly share code, notes, and snippets.

@olof
Created October 31, 2016 18:52
Show Gist options
  • Save olof/436be0ac6f35ee31966c4161ef21c48f to your computer and use it in GitHub Desktop.
Save olof/436be0ac6f35ee31966c4161ef21c48f to your computer and use it in GitHub Desktop.
little endian hex to big endian dot decimal notation
perl -E 'say join(".", map {hex} reverse( shift =~ /(..)/g ) )' 0100007F
@olof
Copy link
Author

olof commented Oct 31, 2016

We can golf a little bit as well:

perl -E '$,=".";say map{hex}reverse(pop=~/(..)/g)' 0100007F

This can likely be improved upon...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment