qubip_aurora 0.11.0

A framework to build OpenSSL Providers tailored for the transition to post-quantum cryptography
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use itertools::Itertools;

/// Formats `bytes` as a colon-separated string of hex values, with `bytes_per_line` elements on
/// each line, indented by `indent` spaces.
pub(crate) fn format_hex_bytes(bytes_per_line: usize, indent: usize, bytes: &[u8]) -> String {
    bytes
        .iter()
        .map(|b| format!("{:02x}", b))
        .chunks(bytes_per_line)
        .into_iter()
        .map(|mut row| format!("{:indent$}{}", "", row.join(":")))
        .join(":\n")
}