0.0
No commit activity in last 3 years
No release in over 3 years
Identiconify makes it super simple to generate identicons representing string values such as usernames or ip addresses.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0

Runtime

>= 1.2.9, ~> 1.2
 Project Readme

Code Climate

Identiconify

Identiconify makes it super simple to generate identicons representing string values such as usernames or ip addresses.

Installation

Add this line to your application's Gemfile:

gem "identiconify"

And then execute:

$ bundle

Or install it yourself as:

$ gem install identiconify

Usage

Require the Identiconify

require "identiconify"

Now you have access to the Identiconify::Identicon class which can be use as such:

string = "this is my string"
identicon = Identiconify::Identicon.new(string)
png_data = identicon.to_png_blob

The png data can then be written to disk or be sent over an http connection.

File.open("image.png", "w") do |file|
  file.write(png_data)
end

To specify the desired size of the identicon (in pixels), pass the widht option to the constructor.

identicon = Identiconify::Identicon.new(string, width: 512)

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request