Skip to content

Latest commit

 

History

History
29 lines (19 loc) · 1.73 KB

README.md

File metadata and controls

29 lines (19 loc) · 1.73 KB

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.