Skip to content

Instantly share code, notes, and snippets.

@guedes
Forked from alco/gist:6715876
Created September 26, 2013 17:38
Show Gist options
  • Save guedes/6717736 to your computer and use it in GitHub Desktop.
Save guedes/6717736 to your computer and use it in GitHub Desktop.
# 3 runs
iex(19)> :timer.tc fn -> <<x :: size(128) >> = :crypto.md5("lol"); hd(:io_lib.format("~32.16.0b", [x])) |> iolist_to_binary end
{127, "9cdfb439c7876e703e307864c9167a15"}
iex(20)> :timer.tc fn -> <<x :: size(128) >> = :crypto.md5("lol"); hd(:io_lib.format("~32.16.0b", [x])) |> iolist_to_binary end
{128, "9cdfb439c7876e703e307864c9167a15"}
iex(21)> :timer.tc fn -> <<x :: size(128) >> = :crypto.md5("lol"); hd(:io_lib.format("~32.16.0b", [x])) |> iolist_to_binary end
{98, "9cdfb439c7876e703e307864c9167a15"}
# 3 runs
iex(22)> :timer.tc fn -> bc << char >> inbits :crypto.md5("lol"), do: << integer_to_binary(char, 16) :: binary >> end
{537, "9CDFB439C7876E703E307864C9167A15"}
iex(23)> :timer.tc fn -> bc << char >> inbits :crypto.md5("lol"), do: << integer_to_binary(char, 16) :: binary >> end
{429, "9CDFB439C7876E703E307864C9167A15"}
iex(24)> :timer.tc fn -> bc << char >> inbits :crypto.md5("lol"), do: << integer_to_binary(char, 16) :: binary >> end
{597, "9CDFB439C7876E703E307864C9167A15"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment