Darren Newton <info@v25media.com>
A small framework for generating identicons.
raco pkg install identikon
raco pkg update identikon
raco identikon --help
procedure
heightinput[ rules#:filenameboolean?]) → image?width:exact-positive-integer?height:exact-positive-integer?boolean?:#t=#f
Produces an identikon with dimensions specified by width and height.
input is converted into a list of numbers based on a SHA1 hash and passed to a rules module for processing into an image?.
rules is the name of the rules module to use in generating the identicon. This defaults to "default".
If #:filename is #t then identikon will treat the value of input as a filename and attempt fo open it for processing.
Examples:
Create a 300x300px identicon for "racket" using the "default.rkt" rule module.
Create a 300x300 identicon for "racket" using the "squares.rkt" rule module.
procedure
typeimagefilename:string?image:image?
#:quality only affects jpeg images.
procedure
imageimage:image?
Available types are svg, png and jpeg.
svg will emit a well formed SVG element.
png and jpeg types will emit a string of base-64 encoded bytes suitable for use in an HTML data-uri.
#:quality only affects jpeg images.
(identikon->string (identikon 300300'racket'qbert)'svg)
All rules modules must provide a single draw-rules function and live in the rules folder.
width:exact-positive-integer?height:exact-positive-integer?
> (draw-rules200200'(2718020017618977681561211209117218721463814418424176))
This module is under the MIT license.
Source repository at https://github.com/DarrenN/identikon. Suggestions, corrections and pull-requests welcome.