pub fn parse_binary(n: &str) -> Vec<u8> ⓘExpand description
Parse a string representing a binary number into a Vec
Always use if is_binary() returns true on that string.
Examples:
use str_to_bytes::{is_binary, parse_binary};
let bin_str: &str = "0b1010001";
if is_binary(bin_str) {
let bytes = parse_binary(bin_str);
println!("{:?}", bytes);
}