Crates.io | mim |
lib.rs | mim |
version | 0.1.0 |
source | src |
created_at | 2022-12-29 11:27:31.376361 |
updated_at | 2022-12-29 11:27:31.376361 |
description | MIM is a Hash Visualization algorithm utilising 4x4 colour matrixes. This provides a quick and easy method to compare fingerprints, e.g. SSH keys, x509 certs etc. |
homepage | |
repository | https://github.com/go-compile/mim-rs |
max_upload_size | |
id | 747265 |
size | 33,937 |
A rusty implementation.
MIM is a Hash Visualization algorithm utilising 4x4 colour matrixes. This provides a quick and easy method to compare fingerprints, e.g. SSH keys, x509 certs etc.
[ Go Implementation ] [ Rust Implementation ]
MIM outputs coloured ANSI escape codes.
use mim::{Mozaic};
use sha2::{Sha256,Digest};
use hex;
fn main() {
// create the fingerprint in the typical way
let mut hasher = Sha256::new();
hasher.update("certificate contents would typically go here");
let fingerprint = hasher.finalize();
// provide the fingerprint to MIM
let moz = Mozaic::new(&fingerprint);
// print fingerprint
println!("Fingerprint: {}", hex::encode(&fingerprint));
// print Mozaic as ASNI
println!("\n{}", &moz.ansi());
}