Skip to content

Instantly share code, notes, and snippets.

@rnewson
Last active August 29, 2015 14:12
Show Gist options
  • Save rnewson/a37acb674dc6e5fea135 to your computer and use it in GitHub Desktop.
Save rnewson/a37acb674dc6e5fea135 to your computer and use it in GitHub Desktop.
-include_lib("eunit/include/eunit.hrl").
md5_collision_test() ->
Bin1 = <<93,17,105,62,30,51,75,44,179,136,239,170,240,208,236,
243,145,45,115,10,28,221,122,172,110,60,224,228,206,6,
123,177,142,115,199,186,162,106,168,25,102,194,134,22,
179,79,61,7,170,183,200,30,50,148,137,100,124,17,115,74,
63,175,3,234>>,
Bin2 = <<93,17,105,62,30,51,75,44,179,136,239,170,240,208,236,
243,145,45,115,10,28,221,122,172,110,60,224,228,206,6,
123,177,142,115,199,188,162,106,168,25,102,194,134,22,
179,79,61,7,170,183,200,30,50,148,137,228,124,17,115,74,
63,175,3,234>>,
?assertNot(Bin1 == Bin2),
?assertEqual(crypto:md5(Bin1), crypto:md5(Bin2)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment