#hex-string #buffer #binary #nice #shortened

pretty-hash

Output binary buffers as a nice, shortened hex string

6 releases

Uses old Rust 2015

0.4.1 Jan 14, 2020
0.4.0 Oct 18, 2018
0.2.0 May 9, 2018
0.1.2 Apr 4, 2018

#975 in Algorithms

Download history 15/week @ 2023-11-19 11/week @ 2023-11-26 264/week @ 2023-12-03 91/week @ 2023-12-10 5/week @ 2023-12-17 3/week @ 2023-12-24 6/week @ 2023-12-31 250/week @ 2024-01-07 112/week @ 2024-01-14 6/week @ 2024-01-21 10/week @ 2024-01-28 74/week @ 2024-02-11 42/week @ 2024-02-18 63/week @ 2024-02-25 25/week @ 2024-03-03

204 downloads per month
Used in 4 crates (2 directly)

MIT/Apache

12KB

pretty-hash

crates.io version build status downloads docs.rs docs

Output binary buffers as a nice, shortened hex string. Adapted from pfrazee/pretty-hash.

Usage

extern crate pretty_hash;

let hash = pretty_hash::fmt(b"1234").unwrap();
assert_eq!(hash, "31323334");

let hash = pretty_hash::fmt(b"12345").unwrap();
assert_eq!(hash, "313233..35");

Installation

$ cargo add pretty-hash

License

MIT OR Apache-2.0

Dependencies

~64KB