Function sbxor::is_english[][src]

pub fn is_english(s: &String, wordy: &Words) -> bool

Checks if the decoded string is English

Examples

extern crate words;
extern crate sbxor;
use sbxor::*;
use words::*;
let encoded_str = 
"1b37373331363f78151b7f2b783431333d78397828372d363c78373e783a393b3736".to_string();
let mut wordy = Words::new();
wordy.populate();
let mut sbxor = Sbxor::create(encoded_str);
sbxor.decode_sbxor();
while sbxor.decoded_strs.len() > 0 {
    if is_english(&sbxor.decoded_strs.pop().unwrap(), &wordy) {
        sbxor.is_english = true;
        break;
    }
} 
assert!(sbxor.is_english);