#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

#1695 in Algorithms

Download history 152/week @ 2024-09-11 46/week @ 2024-09-18 152/week @ 2024-09-25 74/week @ 2024-10-02 14/week @ 2024-10-09 47/week @ 2024-10-16 120/week @ 2024-10-23 30/week @ 2024-10-30 22/week @ 2024-11-06 54/week @ 2024-11-13 45/week @ 2024-11-20 33/week @ 2024-11-27 42/week @ 2024-12-04 45/week @ 2024-12-11 15/week @ 2024-12-18

105 downloads per month
Used in 6 crates (3 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

~65KB