Giter Site home page Giter Site logo

avatar-practice's Introduction

avatar-practice

From the Go Bootcamp: Given a personal information such as an email address, IP address, or a public key, the program you will write needs to generate a unique avatar. Imagine that you are building a new application and you want all of your users to have a default and unique avatar. The package you will write will allow the generation of such avatars. GitHub recently used such an approach and generates an identicon for all new users who don't have a gravatar account attached.

Resources

http://golang.org/pkg/crypto/
http://golang.org/pkg/image/
http://en.wikipedia.org/wiki/Identicon
http://haacked.com/archive/2007/01/22/Identicons_as_Visual_Fingerprints.aspx/

Takeaways & challenges

After working on this for a while, I've learned that the main challenge of this exercise is to figure out the best logic for associating the values in the hash with characteristics of the desired image. I found this challenging and am still working on ways to improve it so that each image is truly unique. Right now, the uniqueness depends mainly on the colors in the image, which originate from some of the hash values. For instance, the following inputs have these results:

Update: The way the image is filled is changed to use each of the values of the hash. This might be the most hack solution possible, but it creates a pretty cool effect for the resulting png, which is more unique in most cases. See below for updates!

input: hello

hello New version ➡️ hello2

input: hellomy

hellomy New version ➡️ hellomy2

input: hellomyname

hellomyname New version ➡️ hellomyname2

input: hellomynameis

hellomynameis New version ➡️ hellomynameis2

input: hellomynameiszoe

hellomynameiszoe New version ➡️ hellomynameiszoe2

avatar-practice's People

Contributors

zoe-gonzales avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.