summaryrefslogtreecommitdiffstats
path: root/src/lib.rs
blob: 52886557ee4343abf9b16494cd08545f0248f5ac (plain) (blame)
1
2
3
4
5
6
7
8
9
extern crate "rustc-serialize" as serialize;

use serialize::base64::{ToBase64,STANDARD};
use serialize::hex::FromHex;

pub fn hex_to_base64 (hex: &str) -> String {
    let bytes = hex.from_hex().unwrap();
    return bytes.to_base64(STANDARD);
}