#identicon #image #avatar #graphics

identicon-rs

identicon-rs is a library built around custom generation of identicon images

28 stable releases (5 major)

new 5.0.1 Jul 25, 2024
5.0.0 Mar 12, 2024
4.0.3 Jan 30, 2024
4.0.1 Jan 2, 2023
0.2.2 Feb 21, 2019

#134 in Images

Download history 136/week @ 2024-04-02 176/week @ 2024-04-09 175/week @ 2024-04-16 188/week @ 2024-04-23 411/week @ 2024-04-30 210/week @ 2024-05-07 312/week @ 2024-05-14 226/week @ 2024-05-21 108/week @ 2024-05-28 241/week @ 2024-06-04 304/week @ 2024-06-11 256/week @ 2024-06-18 286/week @ 2024-06-25 202/week @ 2024-07-02 332/week @ 2024-07-09 190/week @ 2024-07-16

1,072 downloads per month

MIT/Apache

28KB
397 lines

Identicon-rs

Rust dependency status Crates.io Documentation

This is an Identicon implementation in rust.

Example

use identicon_rs::error::IdenticonError;
use identicon_rs::Identicon;

fn main() -> Result<(), IdenticonError> {
    let conways_glider = String::from("conways-glider");
    let test_string = "identicon_rs";

    // stored example
    let identicon_conways_glider = Identicon::new(&conways_glider);
    identicon_conways_glider.save_image("output_1.png")?;

    // chained example with no border
    Identicon::new(test_string)
        .set_border(0)
        .save_image("output_2.png")?;
    Ok(())
}

You can run this example with cargo run --example main.

The repository contains an example webservice that you can run with cargo run --example webserver.

You will obtain images analogous to the following ones:

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~4.5MB
~78K SLoC