Crates.io | robohash |
lib.rs | robohash |
version | 0.2.3 |
source | src |
created_at | 2022-12-05 16:55:01.807009 |
updated_at | 2022-12-09 11:45:13.582687 |
description | RoboHash implementation |
homepage | https://github.com/kyco/robohash |
repository | https://github.com/kyco/robohash |
max_upload_size | |
id | 730468 |
size | 25,819 |
Rust implementation of RoboHash by e1ven
robohash = "0.2.3"
use std::fmt::Error;
use robohash::RoboHashBuilder;
fn main() -> Result<(), Error> {
let text = "test";
let robo = RoboHashBuilder::new(text).build();
let robo_hash = robo.assemble_base64()?;
println!("{robo_hash:#?}");
Ok(())
}
let width = 512;
let height = 512;
let robo = RoboHashBuilder::new("test")
.with_size(width, height)
.build();
let robo = RoboHashBuilder::new("test")
.with_colour("green")
.build();
let robo = RoboHashBuilder::new("test")
.with_set("set3")
.build();
let robo = RoboHashBuilder::new("test")
.with_set_location("./sets_location")
.build();
let robo = RoboHashBuilder::new("test")
.with_background_set("bg1")
.build();
let robo = RoboHashBuilder::new("test")
.with_background_location("./backgrounds")
.build();
use std::fmt::Error;
use robohash::RoboHashBuilder;
fn main() -> Result<(), Error> {
let text = "test";
let robo = RoboHashBuilder::new(text)
.with_set("set1")
.with_colour("green")
.with_set_location("./sets-root")
.with_background_set("bg1")
.with_background_location("./backgrounds")
.with_size(512, 512)
.build();
let robo_hash = robo.assemble_base64()?;
println!("{robo_hash:#?}");
Ok(())
}