bishop 0.1.1

Library for visualizing keys and hashes using OpenSSH's Drunken Bishop algorithm
Documentation

Library for visualizing data using The Drunken Bishop algorithm implemented in Rust

Drunken Bishop is the algorithm used in OpenSSH's ssh-keygen for visualising generated keys

CLI app:

GitHub crates.io

bishop-cli (bishop) - CLI app for visualising hex or binary data


Reference used for this implementation: http://www.dirk-loss.de/sshvis/drunken_bishop.pdf

Example

Cargo.toml:

[dependencies]
bishop = "x.x.x"

Use current latest version: Latest version

main.rs:

use bishop::bishop as bs;

use std::io::{Read, BufReader};
use std::fs::File;

fn main() {
    let cfg = bs::Options::default();

    // from file to String
    let file = File::open("some_file").unwrap();
    let art = bs::art_str(&mut BufReader::new(file).bytes(), &cfg).unwrap();
    println!("{}", art);

    // from vec to String
    let src = vec![1u8, 3, 3, 7];
    let art = bs::art_str(&src, &cfg).unwrap();
    println!("{}", art);

    // from slice to stdout
    let src = [1u8, 2, 3, 4, 5];
    bs::art_print(src.as_ref(), &cfg, |p| println!("{}", p)).unwrap();
}

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.