Function ascii_converter::binary_to_string[][src]

pub fn binary_to_string(bin: &Vec<u32>) -> Result<String, String>
Expand description

This function returns a string made from the binary values passed to it.

This function will take a Vec<u32>, each u32 element will be converted to its a char value and then return as a string.

Example

use ascii_converter::*;
 
let input = vec! [1001000, 1100101, 1101100, 1101100, 1101111, 100000, 1110111, 1101111, 1110010, 1101100, 1100100, 100001];
 
assert_eq!(binary_to_string(&input).unwrap(), "Hello world!".to_string());