Skip to content

C library for creating identicons from strings

License

GPL-3.0, GPL-3.0 licenses found

Licenses found

GPL-3.0
LICENSE
GPL-3.0
COPYING
Notifications You must be signed in to change notification settings

Ansa89/identicon-c

Repository files navigation

Identicon

C library for creating identicons from strings.

The original algorithm for identicon creation is from identicon.js by stewartlord.

The cairo directory contains the initial version and shouldn't be used (consider it like a proof of concept).

Compiling

Support for libpng will be automatically enabled if needed library is found (this has nothing to do with libpng support in example code).

You can choose from 3 different libraries to calculate the hash:

1 WARNING: libsodium doesn't have functions to calculate MD5 and SHA1, so I used crypto_generichash which produces a different hash compared to coreutils and openssl counterparts (and thus a different identicon will be created).

Example code

You can build example code with make example and then run ./example to see what options it needs.

You can choose from 4 different libraries to write PNGs:

  • lodepng (this is the default)
  • stb (make USE_STB=1 example)
  • libpng (make USE_LIBPNG=1 example)
  • cairo (make USE_CAIRO=1 example)

Note that lodepng and stb don't need any additional dependency.

About

C library for creating identicons from strings

Topics

Resources

License

GPL-3.0, GPL-3.0 licenses found

Licenses found

GPL-3.0
LICENSE
GPL-3.0
COPYING

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published