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
Download history 82/week @ 2024-06-18 170/week @ 2024-06-25 39/week @ 2024-07-02 106/week @ 2024-07-09 56/week @ 2024-07-16 56/week @ 2024-07-23 70/week @ 2024-07-30 104/week @ 2024-08-06 57/week @ 2024-08-13 47/week @ 2024-08-20 84/week @ 2024-08-27 84/week @ 2024-09-03 49/week @ 2024-09-10 81/week @ 2024-09-17 171/week @ 2024-09-24 168/week @ 2024-10-01

476 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