identicon-rs 7.2.1

identicon-rs is a library built around custom generation of identicon images.
Documentation
1
2
3
4
5
6
7
8
9
10
/// Identicon grid generation.
///
/// The hash determines the grid. Each even byte is an active square.
pub fn generate_full_grid<T: Into<u32>>(image_size: T, hash: &[u8]) -> Vec<bool> {
    // Compute the hash value
    let square_count = (image_size.into() as usize).pow(2);
    (0..square_count)
        .map(|location| hash[location % hash.len()].is_multiple_of(2))
        .collect()
}