# rust-base64 [![Build Status](https://travis-ci.org/WatchDG/rust-base64.svg?branch=master)](https://travis-ci.org/WatchDG/rust-base64) [![Build status](https://ci.appveyor.com/api/projects/status/5rxe96yuvn84b1y6/branch/master?svg=true)](https://ci.appveyor.com/project/WatchDG/rust-base64/branch/master) [![Docs.rs](https://docs.rs/wdg-base64/badge.svg)](https://docs.rs/wdg-base64) [![Crates.io](https://img.shields.io/crates/v/wdg-base64.svg)](https://crates.io/crates/wdg-base64) [![License](https://img.shields.io/crates/l/wdg-base64.svg)](https://github.com/WatchDG/rust-base64/blob/master/LICENSE) # Install Cargo.toml ``` Rust [dependencies] wdg-base64="*" ``` # How to use? ``` B64::::encode(data); B64::::decode(data); ``` # Examples ``` Rust extern crate wdg_base64; use wdg_base64::{B64,B64Encode,B64Decode}; fn main(){ // u8 println!("{}",B64::::encode(5u8)); println!("{}",B64::::decode(String::from("BQ=="))); // u16 println!("{}",B64::::encode(5u16)); println!("{}",B64::::decode(String::from("AAU="))); } ``` # How to use function pointers? ``` Rust extern crate wdg_base64; use wdg_base64::{B64,B64Encode,B64Decode}; fn main(){ let u8b64:fn(u8)->String=B64::::encode; let b64u8:fn(String)->u8=B64::::decode; assert_eq!(B64::::encode(10u8),u8b64(10u8)); assert_eq!(B64::::decode(String::from("Cg==")),b64u8(String::from("Cg=="))); assert_eq!(b64u8(u8b64(10u8)),10u8); } ```