#pretty-print #display #pretty #byte

display_bytes

Human-readable display of byte sequences

3 unstable releases

Uses old Rust 2015

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

#914 in Text processing

Download history 78/week @ 2024-12-18 17/week @ 2024-12-25 33/week @ 2025-01-01 130/week @ 2025-01-08 84/week @ 2025-01-15 81/week @ 2025-01-22 101/week @ 2025-01-29 230/week @ 2025-02-05 128/week @ 2025-02-12 157/week @ 2025-02-19 142/week @ 2025-02-26 82/week @ 2025-03-05 166/week @ 2025-03-12 107/week @ 2025-03-19 152/week @ 2025-03-26 190/week @ 2025-04-02

626 downloads per month
Used in 5 crates (4 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