#display #bytes #pretty #print

display_bytes

Human-readable display of byte sequences

3 unstable releases

0.2.1 Aug 23, 2019
0.2.0 Jun 21, 2018
0.1.0 Jul 23, 2017

#26 in Value formatting

Download history 21/week @ 2019-12-15 15/week @ 2019-12-22 9/week @ 2019-12-29 10/week @ 2020-01-05 44/week @ 2020-01-12 31/week @ 2020-01-19 35/week @ 2020-01-26 38/week @ 2020-02-02 114/week @ 2020-02-09 138/week @ 2020-02-16 113/week @ 2020-02-23 127/week @ 2020-03-01 90/week @ 2020-03-08 81/week @ 2020-03-15 90/week @ 2020-03-22 105/week @ 2020-03-29

197 downloads per month
Used in 6 crates (3 directly)

MIT/Apache

26KB
452 lines

display_bytes Travis Crates.io

Human-readable display of byte sequences.

Supports printing of both UTF-8 and ASCII-only sequences.

extern crate display_bytes;

use display_bytes::{display_bytes, display_bytes_string};

fn main() {
    let bytes = b"Hello, world!\x89\x90\xAB\xCD";
    println!("{:?}", bytes);
    println!("{}", display_bytes(bytes));
    assert_eq!(display_bytes_string(bytes),
               "Hello, world! {{ 89 90 AB CD }}");
}

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.

No runtime deps