Sitemap
Enrique Barragán

Enrique Barragán

Full-stack developer and data scientist. Passionate about technology. I write about my experiences as a foreign student in Monterrey, Mexico.

#100DaysOfCode Day 3: Identicon

1 min readJan 6, 2017
Press enter or click to view image in full size

I started taking a course on Elixir and Functional Programming as I’ve heard that it’s gaining popularity again. It’s really interesting to see all the differences between programming paradigms, Elixir’s pattern matching is great but will take me some time to get used to it.

For the creation of the Identicon first I had to transform the input text to a hash, I did this using the :crypto atom that converted the text using md5.

Get Enrique Barragán’s stories in your inbox

Join Medium for free to get updates from this writer.

After that I had to create a grid for the identicon, some simple array struct manipulation helped me mirror the rows. After I had the grid ready I took the first three numbers and turned them into a color which would be used if the number was even.

In another function I deleted from the grid the odd numbers with the map helper. Finally using :egd I painted the respective identicon to the input string.

If you’re interested in testing out the app you can check it out in my Github Repo.

Tomorrow I’ll continue working with more Data Science in Python after this short break in Elixir.

--

--

Enrique Barragán
Enrique Barragán

Written by Enrique Barragán

Full-stack developer and data scientist. Passionate about technology. I write about my experiences as a foreign student in Monterrey, Mexico.