Skip to content

Instantly share code, notes, and snippets.

@ttvd
Created May 3, 2015 04:56
Show Gist options
  • Save ttvd/318ac280cdc9969588e7 to your computer and use it in GitHub Desktop.
Save ttvd/318ac280cdc9969588e7 to your computer and use it in GitHub Desktop.
Elixir detect endianness
defp endianness() when <<1::integer-little-size(4)-unit(8)>> == <<1::integer-native-size(4)-unit(8)>>, do: :endianness_little
defp endianness(), do: :endianness_big
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment