Jdenticon

Open source library for generating identicons.

A modern browser is needed to generate jdenticons.

Jdenticon

Open source library for generating identicons.

JavaScript Get started .NET Get started

identicon

An Identicon is a visual representation of a hash value, usually of an IP address, that serves to identify a user of a computer system as a form of avatar while protecting the users' privacy.

Wikipedia

Quick start

JavaScript

Include the Jdenticon library somewhere on your page. Below is Jdenticon served from jsDelivr, but you can download and host it yourself as well.

<script src="https://cdn.jsdelivr.net/npm/jdenticon@1.7.2" async>
</script>

Add a canvas element where you want to render an identicon. Use the data-jdenticon-value attribute to specify that an identicon should be rendered on the canvas. user127 below is just an example of a value.

<canvas data-jdenticon-value="user127" width="80" height="80">
  Text for browsers not supporting canvas.
</canvas>

Refresh the page and voila! See Get started for usage on Node.js or the documentation for more information.

.NET

Install the Jdenticon-net NuGet package.

PM> Install-Package Jdenticon-net

Use the Identicon class to create identicons.

using Jdenticon;

class Program
{
    static void Main() 
    {
        Identicon
            .FromValue("string to hash", size: 160)
            .SaveAsPng("test.png");
    }
}

See Get started or the documentation for more examples.

Supported platforms

Chrome v7 and later
Firefox v4 and later
Opera 11 and later
Internet Explorer 9 and later
Microsoft Edge
Node.js
.NET Framework 2.0 and later
.NET Standard 1.0 and later
.NET Core 1.0 and later
  • Chrome v7 and later
  • Firefox v4 and later
  • Opera 11 and later
  • Internet Explorer 9 and later
  • Microsoft Edge
  • Node.js
  • .NET Framework 2.0 and later
  • .NET Standard 1.0 and later
  • .NET Core 1.0 and later

License

Jdenticon is released under the terms of the zlib license.

Copyright (c) 2014-2017 Daniel Mester Pirttijärvi

This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:

  1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
  2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
  3. This notice may not be removed or altered from any source distribution.