br-crypto 0.4.8

This is an crypto
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::io::{Error};
use quoted_printable::{decode as qp_decode, ParseMode, encode as qp_encode};

pub fn decode<T: AsRef<[u8]>>(text: T) -> Result<Vec<u8>, Error> {
    match qp_decode(text, ParseMode::Robust) {
        Ok(e) => Ok(e),
        Err(e) => Err(Error::other(e))
    }
}

pub fn encode(text: &str) -> String {
    let encoded = qp_encode(text);
    String::from_utf8(encoded).unwrap()
}