pub fn ascii_format(asciish: &[u8]) -> String {
	let mut r = String::new();
	let mut latch = false;
	for c in asciish {
		match (latch, *c) {
			(false, 32...127) => r.push(*c as char),
			_ => {
				if !latch {
					r.push('#');
					latch = true;
				}
				r.push_str(&format!("{:02x}", *c));
			}
		}
	}
	r
}
/// Format into ASCII + # + hex, suitable for storage key preimages.
Format into ASCII + # + hex, suitable for storage key preimages.
Format into ASCII + # + hex suitable for storage key preimages .
pub fn ascii_format(asciish: &[u8]) -> String {
	let mut r = String::new();
	let mut latch = false;
	for c in asciish {
		match (latch, *c) {
			(false, 32...127) => r.push(*c as char),
			_ => {
				if !latch {
					r.push('#');
					latch = true;
				}
				r.push_str(&format!("{:02x}", *c));
			}
		}
	}
	r
}
pub fn ascii_format ( asciish : & [ u8 ] ) -> String { let mut r = String :: new ( ) ; let mut latch = false ; for c in asciish { match ( latch , * c ) { ( false , 32 ... 127 ) => r . push ( * c as char ) , _ => { if ! latch { r . push ( '#' ) ; latch = true ; } r . push_str ( & format ! ( " " c ) ) ; } } } r }
Format into ASCII + # + hex, suitable for storage key preimages.
Format into ASCII + # + hex suitable for storage key preimages .
asciish
&[u8]
asciish
&[u8]