Function oath::from_hex
[−]
[src]
pub fn from_hex(data: &str) -> Result<Vec<u8>, &str>
This library provides a wrapper around rustc_hex::from_hex()
.
This helps with the functions that expect byte arrays.
Examples
extern crate oath; use oath::{totp_raw_now, HashType}; fn main () { let seed = oath::from_hex("ff").unwrap(); totp_raw_now(seed.as_slice(), 6, 0, 30, &HashType::SHA1); }