Easy To Deploy Identicon Handler

Yesterday I mentioned that Jeff Atwood and Jon Galloway wrote an Identicon implementation for .NET. It works beautifully, but they distributed the code as a Web Site Project, which I cannot deploy to my blog as is.

For those of us who prefer Web Application projects, I repackaged their code as compiled DLL and a handler file. This distribution will work for both Web Application Projects as well as Website Projects.

Just download the binaries, copy the DLL to your bin directory, copy the IdenticonHandler.ashx file to your website directory, and you are good to go. You can simply add an image tag that references your identicon handler.

<img src="IdenticonHandler.ashx?hash=hash-of-ip-address" />

[Download Binaries]

You can also grab the Solution I used to prepare the binaries.

[Download Source]

Gravatar Tip!

If you use Gravatar, consider using the identicon handler as the default image. That’s what I did for this website. That way, if the user does not have a gravatar, the identicon will show up instead. Better than nothing!

What others have said

Requesting Gravatar... Jeff Atwood Jan 22, 2007 1:46 AM
# re: Easy To Deploy Identicon Handler
Does it work? It doesn't show a preview of the Identicon :(

This is a test comment
Requesting Gravatar... Jon Galloway Jan 22, 2007 2:34 AM
# re: Easy To Deploy Identicon Handler
I can't wait to see my identicon!
Requesting Gravatar... Jeff Atwood Jan 22, 2007 2:52 AM
# re: Easy To Deploy Identicon Handler
We gotta get rid of that sub background, it really doesn't work with the Identicon overlaid. IMHO.
Requesting Gravatar... Haacked Jan 22, 2007 3:15 AM
# re: Easy To Deploy Identicon Handler
Jeff, you probably have my stylesheet cached. Hit CTRL+F5.
Requesting Gravatar... matt Jan 22, 2007 3:23 AM
# re: Easy To Deploy Identicon Handler
my identicon?
Requesting Gravatar... Daruku Jan 22, 2007 4:27 AM
# re: Easy To Deploy Identicon Handler
Do I have an identicon?
Requesting Gravatar... Jeff Atwood Jan 22, 2007 4:44 AM
# re: Easy To Deploy Identicon Handler
The identicon really needs to be part of "Live Comment Preview", below ;)
Requesting Gravatar... Haacked Jan 22, 2007 5:08 AM
# re: Easy To Deploy Identicon Handler
Yeah, I know. But I don't have the time for all that right now. This was a spur of the moment "Hack" job.
Requesting Gravatar... chadly Jan 22, 2007 5:36 AM
# re: Easy To Deploy Identicon Handler
one for me too?
Requesting Gravatar... Daruku Jan 22, 2007 6:16 AM
# re: Easy To Deploy Identicon Handler
Do I still have the same identicon?
Requesting Gravatar... Dan Jan 22, 2007 6:30 AM
# re: Easy To Deploy Identicon Handler
just want to see my gravatar
Requesting Gravatar... Jeremy Jan 22, 2007 7:16 AM
# re: Easy To Deploy Identicon Handler
Can't wait to see what mine is... it's like opening a Christmas present.
Requesting Gravatar... Scott Hanselman Jan 22, 2007 7:44 AM
# re: Easy To Deploy Identicon Handler
Very exciting!
Requesting Gravatar... Scott Hanselman Jan 22, 2007 7:55 AM
# re: Easy To Deploy Identicon Handler
Hm...my IP hasn't changed, why is my icon different HERE than at Don's?
Requesting Gravatar... Haacked Jan 22, 2007 8:08 AM
# re: Easy To Deploy Identicon Handler
I'm using a different salt value. It's not a straight hash of your IP. There's a bit of salt thrown in. So it'll only be consistent on my blog.
Requesting Gravatar... Keyvan Nayyeri Jan 22, 2007 12:28 PM
# re: Easy To Deploy Identicon Handler
Very nice :-)
Requesting Gravatar... Don Park Jan 22, 2007 3:12 PM
# re: Easy To Deploy Identicon Handler
Identicons being site-specific enhance privacy, meaning that no one can notice that a comment at a porn torrent forum and a comment here was posted by the same person. ;-)
Requesting Gravatar... F'yth Jan 22, 2007 7:56 PM
# re: Easy To Deploy Identicon Handler
Well my identicon was pink over at Don's.. I wonder what it looks like here. ;D
Requesting Gravatar... Haacked Jan 23, 2007 12:36 AM
# re: Easy To Deploy Identicon Handler
Oh good, then I'm free to post on my porn message boards again. ;)
Requesting Gravatar... Jon Galloway Jan 23, 2007 4:02 PM
# Identicons - Ported from Java Servlet to HttpHandler
Summary Identicons provide a nice visual indicator that's unique to each user on a website. It's unique
Requesting Gravatar... Jan Bannister Jan 23, 2007 6:53 PM
# re: Easy To Deploy Identicon Handler
These are really cool
Requesting Gravatar... jayson knight Jan 23, 2007 7:13 PM
# re: Easy To Deploy Identicon Handler
Shall be implementing this on CS very soon...nice work.
Requesting Gravatar... Luke Jan 23, 2007 8:53 PM
# re: Easy To Deploy Identicon Handler
And mine looks like?
Requesting Gravatar... Asif Raza Jan 23, 2007 8:55 PM
# re: Easy To Deploy Identicon Handler
what will mine look likes
Requesting Gravatar... matt Jan 23, 2007 11:34 PM
# re: Easy To Deploy Identicon Handler
i'm back! i'm addicted to my identicon. what a novel idea.
Requesting Gravatar... Adam Jan 24, 2007 1:03 AM
# re: Easy To Deploy Identicon Handler
Gotta see it
Requesting Gravatar... Jackal Jan 24, 2007 2:04 AM
# re: Easy To Deploy Identicon Handler
Gotta See one.

Thanks for porting this
Requesting Gravatar... pieter Jan 24, 2007 3:53 AM
# re: Easy To Deploy Identicon Handler
please show me mine. ;)
Requesting Gravatar... Jon Jan 24, 2007 6:00 AM
# re: Easy To Deploy Identicon Handler
What does mine look like?
Requesting Gravatar... rachel Jan 24, 2007 6:04 AM
# re: Easy To Deploy Identicon Handler
this is neat!
Requesting Gravatar... Bruce Jan 24, 2007 6:51 AM
# re: Easy To Deploy Identicon Handler
I can't help myself, I just have to see.
Requesting Gravatar... Ben Hyrman Jan 24, 2007 2:18 PM
# re: Easy To Deploy Identicon Handler
You're a life-saver. I wanted a fairly anonymous way to show the last five authors on my site and this fits that bill perfectly. Excellent examples the other day on what an identicon was and great followup today with the handler port.

I've implemented identicons at AintMySite.com, a site that anyone can edit at any time as they see fit (as a result, warning, may or may not be work safe). I think it's a perfect solution for my needs.
Requesting Gravatar... Ricardo Peres Jan 24, 2007 8:53 PM
# re: Easy To Deploy Identicon Handler
Just testing...
Requesting Gravatar... jayson knight Jan 25, 2007 12:51 PM
# re: Easy To Deploy Identicon Handler
Having some issues with the "Easy to Deploy" part. Gimme a shout or I can give details in this thread.
Requesting Gravatar... Jeff Atwood Jan 26, 2007 8:10 AM
# re: Easy To Deploy Identicon Handler
We said EASY TO DEPLOY! Does it help if we say it louder? ;)
Requesting Gravatar... jayson knight Jan 26, 2007 5:22 PM
# re: Easy To Deploy Identicon Handler
Yup, it's perfectly clear now, volume always helps ;-).

"hash=hash-of-ip-address"

What hash is it looking for? I've tried using the Code member in the Util class to hash the IP, I've tried a hashcode, which doesn't work b/c the IP is rehashed in the handler. Red X's abound, and the resulting hash looks way off.

As is usually the case with me, I'm sure I'm overlooking something glaringly obvious and simple.
Requesting Gravatar... Haacked Jan 26, 2007 5:25 PM
# re: Easy To Deploy Identicon Handler
The "hash" query string parameter ought to be a salted hash of the IP Address. When testing, cut and paste the URL into your address bar to see what error messages occur.

Make sure you don't have some sort of rewriting rule intercepting the request to the ashx page.
Requesting Gravatar... Jason Haley Jan 27, 2007 12:21 AM
# Interesting Finds: January 27, 2007
Requesting Gravatar... Ayende Rahien Jan 27, 2007 3:40 AM
# re: Easy To Deploy Identicon Handler
What about mine?
Requesting Gravatar... Tada Feb 04, 2007 3:30 AM
# re: Easy To Deploy Identicon Handler
So this is not useless how?
Requesting Gravatar... Simone Chiaretta Feb 04, 2007 7:54 PM
# re: Easy To Deploy Identicon Handler
Let's see mine
Requesting Gravatar... Simone Feb 05, 2007 11:56 AM
# re: Easy To Deploy Identicon Handler
Trying without specifying email :)
Requesting Gravatar... Vittorio Feb 07, 2007 10:50 PM
# re: Easy To Deploy Identicon Handler
my gravatar please :O
Requesting Gravatar... Dan Jul 12, 2007 7:49 AM
# re: Easy To Deploy Identicon Handler
I'll check into the identicon bit- thanks for the tip.

*testing my gravatar*
Requesting Gravatar... Qwaider قويدر Oct 17, 2007 2:52 AM
# re: Easy To Deploy Identicon Handler
Hi there,
I loved the idea, but decided to implement it for Email addresses instead of IP addresses. And the result was STUNNING!(seriously!)
So now, instead of Gravatar (which is based on Email) I use Gravatar and the default picture is an Identicon. Best part is. Once the identicon is created, I cache it so I don't have to create it once more :)


Thank you that was very helpful
Requesting Gravatar... Johan Jan 23, 2008 5:18 PM
# re: Easy To Deploy Identicon Handler
Cool! I thought i'd have to compile this to a dll myself, but this is much simpler. Big thanks!

(also testing my identicon :)
Requesting Gravatar... Henry Jun 18, 2008 2:11 PM
# re: Easy To Deploy Identicon Handler
Thank you that was very helpful
Requesting Gravatar... togi Jul 11, 2008 5:37 AM
# re: Easy To Deploy Identicon Handler
Neat! I suppose i need to put in a comment here, just to get a identicon :D
Requesting Gravatar... Ch4v3z! Nov 23, 2008 9:44 PM
# fw: Easy To Deploy Identicon Handler
BOF

well, let'see what's my identicon like...

EOF
Requesting Gravatar... hjk Mar 11, 2009 10:34 PM
# re: Easy To Deploy Identicon Handler
lets see it
Requesting Gravatar... Hogan Feb 08, 2010 5:01 AM
# re: Easy To Deploy Identicon Handler
want to see my icon
Requesting Gravatar... Andrew Jun 02, 2010 11:32 PM
# re: Easy To Deploy Identicon Handler
Very cool! Thanks!
Requesting Gravatar... mp3 files search Jun 29, 2010 9:13 PM
# re: Easy To Deploy Identicon Handler
example, given a set of personal artifacts, how would I arrange the set of artifacts grouped by the person to which they belonged?

The answer is quite easy, isn’t it (especially given the title of this blog post and the image to the right)? You can look at the fingerprints on the items.
Requesting Gravatar... viewer Nov 28, 2010 5:53 PM
# re: Easy To Deploy Identicon Handler
Nice, let try it ~~
Requesting Gravatar... mola Dec 30, 2010 4:15 AM
# re: Easy To Deploy Identicon Handler
Some beautiful ones ... some not so much.
Requesting Gravatar... mola2 Dec 30, 2010 4:22 AM
# re: Easy To Deploy Identicon Handler
thanks for making this available - it's so much better than finding a picture, etc.
Requesting Gravatar... Bob Baker Aug 06, 2011 9:50 PM
# re: Easy To Deploy Identicon Handler
Hmm, I'm still not sure what Identicons will be useful for or convinced of their usefulness.
Requesting Gravatar... mike Nov 22, 2011 4:47 AM
# re: Easy To Deploy Identicon Handler
test my identicon
Requesting Gravatar... mike Nov 22, 2011 4:54 AM
# re: Easy To Deploy Identicon Handler
and again
Comments have been closed on this topic.