identicon-rs

Crates.ioidenticon-rs
lib.rsidenticon-rs
version6.0.1
sourcesrc
created_at2019-02-20 06:59:51.013622
updated_at2024-11-28 05:24:19.242056
descriptionidenticon-rs is a library built around custom generation of identicon images.
homepage
repositoryhttps://github.com/conways-glider/identicon-rs
max_upload_size
id115914
size129,361
Nia (conways-glider)

documentation

https://docs.rs/identicon-rs

README

Identicon-rs

Rust dependency status Crates.io Documentation

This is an Identicon implementation in rust.

Documentation

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.

Commit count: 119

cargo fmt